scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <assert.h>
 2#include <stdio.h>
 3#include <string.h>
 4
 5/*
 6output:
 7testing
 8done
 9end:
10*/
11
12
13int
14test(void)
15{
16	int j, i, max;
17	char buf[32][L_tmpnam];
18
19	assert(TMP_MAX >= 25);
20
21	assert(tmpnam(NULL));
22
23        max = TMP_MAX - 1;
24        if (max > FOPEN_MAX - 3)
25                max = FOPEN_MAX - 3;
26        if (max > 32)
27                max = 32;
28
29	for (i = 0; i < max; ++i) {
30		assert(tmpnam(buf[i]));
31		for (j = 0; j < i; j++)
32			assert(strcmp(buf[i], buf[j]) != 0);
33	}
34
35	return 0;
36}
37
38int
39main(void)
40{
41	puts("testing");
42	test();
43	puts("done");
44
45	return 0;
46}