diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-25 01:40:33 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-25 01:40:33 +1300 |
commit | 71e73ac3b4063efeb847781e144b01b49fc9dc98 (patch) | |
tree | 2e3f68035071fc5a9aac4f271d899106452444b2 | |
parent | Add some test C files (diff) | |
download | doomsh-71e73ac3b4063efeb847781e144b01b49fc9dc98.tar.gz doomsh-71e73ac3b4063efeb847781e144b01b49fc9dc98.zip |
Add files test
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | tests/Makefile | 2 | ||||
-rw-r--r-- | tests/files.c | 17 |
3 files changed, 19 insertions, 1 deletions
@@ -1,2 +1,3 @@ +tests/files tests/mem tests/stack diff --git a/tests/Makefile b/tests/Makefile index 8dff5a0..abc4fc5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2,5 +2,5 @@ CC = clang -all : mem stack +all : files mem stack diff --git a/tests/files.c b/tests/files.c new file mode 100644 index 0000000..ff5eaaf --- /dev/null +++ b/tests/files.c @@ -0,0 +1,17 @@ +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> + +/* files.c -- Open as many files as we can */ +int main(void) { + FILE *fp = NULL; + int i = 0; + for (;;i++) { + if ((fp = tmpfile()) == NULL) { + fprintf(stderr, "Created %u files\n", i); + perror("tmpfile"); + raise(SIGABRT); + } + } +} + |