Mercurial > minori
comparison dep/utf8proc/test/valid.c @ 343:1faa72660932
*: transfer back to cmake from autotools
autotools just made lots of things more complicated than
they should have and many things broke (i.e. translations)
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Thu, 20 Jun 2024 05:56:06 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 342:adb79bdde329 | 343:1faa72660932 |
|---|---|
| 1 #include "tests.h" | |
| 2 #include <ctype.h> | |
| 3 #include <wchar.h> | |
| 4 | |
| 5 int main(int argc, char **argv) | |
| 6 { | |
| 7 int c, error = 0; | |
| 8 | |
| 9 (void) argc; /* unused */ | |
| 10 (void) argv; /* unused */ | |
| 11 | |
| 12 /* some simple sanity tests of */ | |
| 13 for (c = 0; c < 0xd800; c++) { | |
| 14 if (!utf8proc_codepoint_valid(c)) { | |
| 15 fprintf(stderr, "Failed: codepoint_valid(%04x) -> false\n", c); | |
| 16 error++; | |
| 17 } | |
| 18 } | |
| 19 for (;c < 0xe000; c++) { | |
| 20 if (utf8proc_codepoint_valid(c)) { | |
| 21 fprintf(stderr, "Failed: codepoint_valid(%04x) -> true\n", c); | |
| 22 error++; | |
| 23 } | |
| 24 } | |
| 25 for (;c < 0x110000; c++) { | |
| 26 if (!utf8proc_codepoint_valid(c)) { | |
| 27 fprintf(stderr, "Failed: codepoint_valid(%06x) -> false\n", c); | |
| 28 error++; | |
| 29 } | |
| 30 } | |
| 31 for (;c < 0x110010; c++) { | |
| 32 if (utf8proc_codepoint_valid(c)) { | |
| 33 fprintf(stderr, "Failed: codepoint_valid(%06x) -> true\n", c); | |
| 34 error++; | |
| 35 } | |
| 36 } | |
| 37 check(!error, "utf8proc_codepoint_valid FAILED %d tests.", error); | |
| 38 printf("Validity tests SUCCEEDED.\n"); | |
| 39 | |
| 40 return 0; | |
| 41 } |
