25 #include <sys/resource.h> 38 for (
int i = 0; i < 1024; ++i)
43 for (
int i = 0; i < 1024; ++i)
49 TEST (allocationtoobig)
52 rl.rlim_cur = 100*1024*1024;
53 rl.rlim_max = 100*1024*1024;
54 setrlimit (RLIMIT_AS, &rl);
70 for (
int i = 0; i < 256; ++i)
74 for (
int j = 0; j < 1024; ++j)
84 char* r =
lumiera_tmpbuf_tr (argv[2],
"abcdeABCDE0123456789",
"ABCDEABCDE0123456789", NULL);
85 printf(
"%s\n", r?r:
"failed");
91 char* r =
lumiera_tmpbuf_tr (argv[2],
"abcdeABCDE0123456789",
"ABCDEABCDE0123456789",
"");
92 printf(
"%s\n", r?r:
"failed");
98 printf(
"%s\n",
lumiera_tmpbuf_tr (argv[2],
"abcdeABCDE0123456789",
"ABCDEABCDE0123456789",
"_"));
Portable and safe wrappers around some C-Lib functions.
void * lumiera_tmpbuf_provide(size_t size)
Query a thread local tmpbuf.
Helpers and support macros for defining test executables in C.
Round robin temporary buffers.
int lumiera_streq(const char *a, const char *b)
check 2 strings for identity.
void * lumiera_malloc(size_t size)
Allocate memory.
char * lumiera_tmpbuf_tr(const char *in, const char *from, const char *to, const char *def)
Translates characters in a string, similar to the shell 'tr' utility.