repo.or.cz
/
libc-test.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
string test alignment fix by Mahesh Bodapati
[libc-test.git]
/
src
/
regression
/
malloc-oom.c
blob
d9a1f6ed6f8b7ce780f60521e7368ae35d97fe99
1
// malloc should set errno on oom
2
#include <stdlib.h>
3
#include <string.h>
4
#include <errno.h>
5
#include
"test.h"
6
7
int
main
(
void
)
8
{
9
if
(
t_memfill
() <
0
)
10
t_error
(
"memfill failed
\n
"
);
11
12
errno
=
0
;
13
if
(
malloc
(
50000
))
14
t_error
(
"malloc was successful
\n
"
);
15
if
(
errno
!=
ENOMEM
)
16
t_error
(
"expected ENOMEM, got %s
\n
"
,
strerror
(
errno
));
17
18
return
t_status
;
19
}