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

Function check_case_conv

deps/quickjs/unicode_gen.c:1855–1900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1853}
1854
1855void check_case_conv(void)
1856{
1857 CCInfo *tab = unicode_db;
1858 uint32_t res[3];
1859 int l, error;
1860 CCInfo ci_s, *ci1, *ci = &ci_s;
1861 int code;
1862
1863 for(code = 0; code <= CHARCODE_MAX; code++) {
1864 ci1 = &tab[code];
1865 *ci = *ci1;
1866 if (ci->l_len == 0) {
1867 ci->l_len = 1;
1868 ci->l_data[0] = code;
1869 }
1870 if (ci->u_len == 0) {
1871 ci->u_len = 1;
1872 ci->u_data[0] = code;
1873 }
1874 if (ci->f_len == 0) {
1875 ci->f_len = 1;
1876 ci->f_data[0] = code;
1877 }
1878
1879 error = 0;
1880 l = check_conv(res, code, 0);
1881 if (l != ci->u_len || tabcmp((int *)res, ci->u_data, l)) {
1882 printf("ERROR: L\n");
1883 error++;
1884 }
1885 l = check_conv(res, code, 1);
1886 if (l != ci->l_len || tabcmp((int *)res, ci->l_data, l)) {
1887 printf("ERROR: U\n");
1888 error++;
1889 }
1890 l = check_conv(res, code, 2);
1891 if (l != ci->f_len || tabcmp((int *)res, ci->f_data, l)) {
1892 printf("ERROR: F\n");
1893 error++;
1894 }
1895 if (error) {
1896 dump_cc_info(ci, code);
1897 exit(1);
1898 }
1899 }
1900}
1901
1902#ifdef PROFILE
1903static int64_t get_time_ns(void)

Callers 1

mainFunction · 0.85

Calls 4

check_convFunction · 0.85
tabcmpFunction · 0.85
dump_cc_infoFunction · 0.85
exitFunction · 0.85

Tested by

no test coverage detected