This source file includes following definitions.
- graphemebreakproperty_to_string
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19
20 #include <unigbrk.h>
21
22 struct uc_gbrk_prop_range
23 {
24 ucs4_t end;
25 int gbp;
26 };
27
28 static const struct uc_gbrk_prop_range set[] =
29 {
30 #include "test-uc-gbrk-prop.h"
31 };
32
33 #include "macros.h"
34
35 const char *
36 graphemebreakproperty_to_string (int gbp)
37 {
38 switch (gbp)
39 {
40 #define CASE(VALUE) case GBP_##VALUE: return #VALUE;
41 CASE(OTHER)
42 CASE(CR)
43 CASE(LF)
44 CASE(CONTROL)
45 CASE(EXTEND)
46 CASE(PREPEND)
47 CASE(SPACINGMARK)
48 CASE(L)
49 CASE(V)
50 CASE(T)
51 CASE(LV)
52 CASE(LVT)
53 CASE(RI)
54 CASE(ZWJ)
55 CASE(EB)
56 CASE(EM)
57 CASE(GAZ)
58 CASE(EBG)
59 }
60 abort ();
61 }
62
63 int
64 main (void)
65 {
66 const struct uc_gbrk_prop_range *r;
67 ucs4_t uc;
68
69 uc = 0;
70 for (r = set; r < set + SIZEOF (set); r++)
71 {
72 for (; uc < r->end; uc++)
73 {
74 int retval = uc_graphemeclusterbreak_property (uc);
75 if (retval != r->gbp)
76 {
77 fprintf (stderr, "uc_graphemeclusterbreak_property(%#x) "
78 "yielded %s but should have been %s\n",
79 uc, graphemebreakproperty_to_string (retval),
80 graphemebreakproperty_to_string (r->gbp));
81 fflush (stderr);
82 abort ();
83 }
84 }
85 }
86 ASSERT (uc == 0x110000);
87
88 return 0;
89 }