Lines Matching +full:0 +full:x001fffff
48 #define L(x) 0
52 * len is 0 for invalid encoding prefixes (KRB5_UTF8_CHARLEN2() partially
54 * byte. It doesn't check whether bit 6 is 0, though, and doesn't catch the
57 * ucs is 0 for invalid encodings (including ones with valid prefixes according
71 { "\x7f", 0x0000007f, 1 }, /* Lowest 1-byte encoding */
72 { "\xc0\x80", 0x00000000, 0 }, /* Invalid 2-byte encoding */
73 { "\xc2\x80", 0x00000080, 2 }, /* Lowest valid 2-byte encoding */
74 { "\xdf\xbf", 0x000007ff, 2 }, /* Highest valid 2-byte encoding*/
75 { "\xdf\xff", 0x00000000, 2 }, /* Invalid 2-byte encoding*/
76 { "\xe0\x80\x80", 0x00000000, 0 }, /* Invalid 3-byte encoding */
77 { "\xe0\xa0\x80", 0x00000800, 3 }, /* Lowest valid 3-byte encoding */
78 { "\xef\xbf\xbf", 0x0000ffff, 3 }, /* Highest valid 3-byte encoding */
79 { "\xef\xff\xff", 0x00000000, 3 }, /* Invalid 3-byte encoding */
80 { "\xf0\x80\x80\x80", 0x00000000, 0 }, /* Invalid 4-byte encoding */
81 { "\xf0\x90\x80\x80", 0x00010000, 4 }, /* Lowest valid 4-byte encoding */
82 { "\xf4\x8f\xbf\xbf", 0x0010ffff, 4 }, /* Highest valid 4-byte encoding */
84 { "\xf4\x90\x80\x80", 0x00110000, 4 },
85 /* Highest 4-byte encoding starting with 0xf4 (old) */
86 { "\xf4\xbf\xbf\xbf", 0x0013ffff, 4 },
88 { "\xf5\x80\x80\x80", 0x00140000, L(4) },
90 { "\xf7\xbf\xbf\xbf", 0x001fffff, L(4) },
92 { "\xf7\xff\xff\xff", 0x00000000, L(4) },
94 { "\xf8\x80\x80\x80\x80", 0x00000000, 0 },
96 { "\xf8\x88\x80\x80\x80", 0x00200000, L(5) },
98 { "\xfb\xbf\xbf\xbf\xbf", 0x03ffffff, L(5) },
100 { "\xfb\xff\xff\xff\xff", 0x00000000, L(5) },
102 { "\xfc\x80\x80\x80\x80\x80", 0x00000000, 0 },
104 { "\xfc\x84\x80\x80\x80\x80", 0x04000000, L(6) },
106 { "\xfd\xbf\xbf\xbf\xbf\xbf", 0x7fffffff, L(6) },
108 { "\xfd\xff\xff\xff\xff\xff", 0x00000000, L(6) },
114 for (; *p != '\0'; p++) { in printhex()
123 printf("0x%08lx, %d\n", (unsigned long)t->ucs, t->len); in printtest()
129 int len, status = 0; in test_decode()
130 krb5_ucs4 u = 0; in test_decode()
137 if ((t->len == 0 || high4) && krb5int_utf8_to_ucs4(t->p, &u) != -1) { in test_decode()
141 if (krb5int_utf8_to_ucs4(t->p, &u) != 0 && t->ucs != 0 && !high4) { in test_decode()
146 printf("expected 0x%08lx, got 0x%08lx\n", (unsigned long)t->ucs, in test_decode()
159 memset(buf, 0, sizeof(buf)); in test_encode()
161 if (high4 && size != 0) { in test_encode()
165 if (!high4 && size == 0) { in test_encode()
169 if (size != 0 && strcmp(t->p, buf) != 0) { in test_encode()
177 return 0; in test_encode()
183 size_t ncases = sizeof(testcases) / sizeof(testcases[0]); in main()
186 int status = 0, verbose = 0; in main()
190 if (argc == 2 && strcmp(argv[1], "-v") == 0) in main()
192 for (i = 0; i < ncases; i++) { in main()
197 high4 = t->ucs > 0x10ffff; in main()
199 high4 = 0; in main()
201 if (test_decode(t, high4) != 0) in main()
203 if (t->ucs == 0) in main()
205 if (test_encode(t, high4) != 0) in main()