| 2919 | } |
| 2920 | |
| 2921 | void 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 | |
| 2953 | void normalization_test(const char *filename) |
| 2954 | { |
no test coverage detected