34 #include <sys/resource.h> 47 for (
int i = 0; i < 1024; ++i)
52 for (
int i = 0; i < 1024; ++i)
58 TEST (allocationtoobig)
61 rl.rlim_cur = 100*1024*1024;
62 rl.rlim_max = 100*1024*1024;
63 setrlimit (RLIMIT_AS, &rl);
79 for (
int i = 0; i < 256; ++i)
83 for (
int j = 0; j < 1024; ++j)
93 char* r =
lumiera_tmpbuf_tr (argv[2],
"abcdeABCDE0123456789",
"ABCDEABCDE0123456789", NULL);
94 printf(
"%s\n", r?r:
"failed");
100 char* r =
lumiera_tmpbuf_tr (argv[2],
"abcdeABCDE0123456789",
"ABCDEABCDE0123456789",
"");
101 printf(
"%s\n", r?r:
"failed");
107 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.