string test alignment fix by Mahesh Bodapati
[libc-test.git] / src / regression / malloc-oom.c
blobd9a1f6ed6f8b7ce780f60521e7368ae35d97fe99
1 // malloc should set errno on oom
2 #include <stdlib.h>
3 #include <string.h>
4 #include <errno.h>
5 #include "test.h"
7 int main(void)
9 if (t_memfill() < 0)
10 t_error("memfill failed\n");
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));
18 return t_status;