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 <wchar.h>
 4
 5/*
 6output:
 7testing
 8done
 9end:
10*/
11
12int
13main()
14{
15	wchar_t *p, buf[] = L"abcad";
16
17	puts("testing");
18
19	p = wcschr(buf, 0);
20	assert(p == buf+5);
21	assert(*p == '\0');
22
23	p = wcschr(buf, 'a');
24	assert(p == buf);
25	assert(*p == 'a');
26
27	p = wcschr(buf, 'd');
28	assert(p == buf+4);
29	assert(*p == 'd');
30
31	p = wcschr(buf, 'c');
32	assert(p == buf+2);
33	assert(*p == 'c');
34
35	p = wcschr(buf, 'h');
36	assert(p == NULL);
37
38	p = wcschr(L"", 'a');
39	assert(p == NULL);
40
41	puts("done");
42
43	return 0;
44}