21 #define create_test(name) \
23 if (!file_exists("compress_generated_" #name)) { \
24 FILE *file = file_create("compress_generated_" #name); \
25 write_ ## name(file); \
26 file_finish(file, "compress_generated_" #name); \
66 const bool ferror_fail = ferror(
file);
67 const bool fclose_fail = fclose(
file);
69 if (ferror_fail || fclose_fail) {
81 for (
size_t i = 0;
i < 12345; ++
i)
82 if (fwrite(
"abc\n", 4, 1,
file) != 1)
94 for (
size_t i = 0;
i < 123456; ++
i) {
95 n = 101771 *
n + 71777;
109 static const char *lorem[] = {
110 "Lorem",
"ipsum",
"dolor",
"sit",
"amet,",
"consectetur",
111 "adipisicing",
"elit,",
"sed",
"do",
"eiusmod",
"tempor",
112 "incididunt",
"ut",
"labore",
"et",
"dolore",
"magna",
113 "aliqua.",
"Ut",
"enim",
"ad",
"minim",
"veniam,",
"quis",
114 "nostrud",
"exercitation",
"ullamco",
"laboris",
"nisi",
115 "ut",
"aliquip",
"ex",
"ea",
"commodo",
"consequat.",
116 "Duis",
"aute",
"irure",
"dolor",
"in",
"reprehenderit",
117 "in",
"voluptate",
"velit",
"esse",
"cillum",
"dolore",
118 "eu",
"fugiat",
"nulla",
"pariatur.",
"Excepteur",
"sint",
119 "occaecat",
"cupidatat",
"non",
"proident,",
"sunt",
"in",
120 "culpa",
"qui",
"officia",
"deserunt",
"mollit",
"anim",
121 "id",
"est",
"laborum."
126 fprintf(
file,
"%s ", lorem[
w]);
136 for (
size_t p = 0;
p < 500; ++
p) {
137 fprintf(
file,
"\n\n");
140 n = 101771 *
n + 71777;
#define create_test(name)
static void write_text(FILE *file)
static void write_random(FILE *file)
static void file_finish(FILE *file, const char *filename)
static bool file_exists(const char *filename)
static void write_abc(FILE *file)
static FILE * file_create(const char *filename)
Common includes, definitions, system-specific things etc.