MCPcopy Create free account
hub / github.com/buke/quickjs-go / check_cc_table

Function check_cc_table

deps/quickjs/unicode_gen.c:2921–2951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2919}
2920
2921void check_cc_table(void)
2922{
2923 int cc, cc_ref, c;
2924
2925 for(c = 0; c <= CHARCODE_MAX; c++) {
2926 cc_ref = unicode_db[c].combining_class;
2927 cc = unicode_get_cc(c);
2928 if (cc != cc_ref) {
2929 printf("ERROR: c=%04x cc=%d cc_ref=%d\n",
2930 c, cc, cc_ref);
2931 exit(1);
2932 }
2933 }
2934#ifdef PROFILE
2935 {
2936 int64_t ti, count;
2937
2938 ti = get_time_ns();
2939 count = 0;
2940 /* only do it on meaningful chars */
2941 for(c = 0x20; c <= 0xffff; c++) {
2942 cc_ref = unicode_db[c].combining_class;
2943 cc = unicode_get_cc(c);
2944 count++;
2945 }
2946 ti = get_time_ns() - ti;
2947 printf("cc time=%0.1f ns/char\n",
2948 (double)ti / count);
2949 }
2950#endif
2951}
2952
2953void normalization_test(const char *filename)
2954{

Callers 1

mainFunction · 0.85

Calls 3

unicode_get_ccFunction · 0.85
exitFunction · 0.85
get_time_nsFunction · 0.85

Tested by

no test coverage detected