aboutsummaryrefslogtreecommitdiffstats
path: root/libutf8_is_valid.c
blob: 8275c347fd53f21698f3196e10c7658c2bb9368b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST


extern inline int libutf8_is_valid(uint_least32_t codepoint);


#else


int
main(void)
{
	unsigned long int i;
	uint_least32_t cp;

	SET_UP_TEST();

	for (i = 0u; i < 0x120000ul; i++) {
		cp = (uint_least32_t)i;
		assert(libutf8_is_valid(cp) == !libutf8_is_invalid(cp));
	}

	return 0;
}


#endif