#include "postgres_fe.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common/unicode_norm.h"
#include "norm_test_table.h"
Go to the source code of this file.
◆ BUF_DIGITS
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 60 of file norm_test.c.
61{
62 const pg_unicode_test *
test;
63
64 for (
test = UnicodeNormalizationTests;
test->input[0] != 0;
test++)
65 {
66 for (int form = 0; form < 4; form++)
67 {
68 char32_t *result;
69
71
73 {
74 printf(
"FAILURE (NormalizationTest.txt line %d form %d):\n",
test->linenum, form);
79 exit(1);
80 }
81 }
82 }
83
84 printf(
"norm_test: All tests successful!\n");
85 exit(0);
86}
static int pg_wcscmp(const char32_t *s1, const char32_t *s2)
static char * print_wchar_str(const char32_t *s)
char32_t * unicode_normalize(UnicodeNormalizationForm form, const char32_t *input)
References pg_wcscmp(), print_wchar_str(), printf, test(), and unicode_normalize().
◆ pg_wcscmp()
Definition at line 44 of file norm_test.c.
45{
46 for (;;)
47 {
49 return -1;
51 return 1;
53 return 0;
56 }
57}
References s1, and s2.
Referenced by main().
◆ print_wchar_str()
| static char * print_wchar_str |
( |
const char32_t * |
s | ) |
|
|
static |
Definition at line 23 of file norm_test.c.
24{
25#define BUF_DIGITS 50
28 char *p;
29
33 {
36 s++;
37 }
38 *p = '\0';
39
41}
static char buf[DEFAULT_XLOG_SEG_SIZE]
References buf, BUF_DIGITS, i, and sprintf.
Referenced by main().