tests/test_string.c

changeset 926
8fdd8d78c14b
parent 890
54565fd74e74
equal deleted inserted replaced
925:fd6e191f3268 926:8fdd8d78c14b
174 } 174 }
175 175
176 CX_TEST(test_strstr) { 176 CX_TEST(test_strstr) {
177 cxstring str = CX_STR("find the match in this string"); 177 cxstring str = CX_STR("find the match in this string");
178 178
179 size_t const longstrpatternlen = 64 + cx_strstr_sbo_size; 179 const size_t longstrpatternlen = 64 + cx_strstr_sbo_size;
180 size_t const longstrlen = 320 + longstrpatternlen + 14; 180 const size_t longstrlen = 320 + longstrpatternlen + 14;
181 181
182 // it is more expensive to use calloc here, because we will overwrite 182 // it is more expensive to use calloc here, because we will overwrite
183 // the memory anyway in the test preparation - but it is more reliable 183 // the memory anyway in the test preparation - but it is more reliable
184 // in case we are doing something horribly wrong 184 // in case we are doing something horribly wrong
185 char *longstrc = calloc(longstrlen+1, 1); 185 char *longstrc = calloc(longstrlen+1, 1);

mercurial