Branch Coverage

text-fuzzy-perl.c
Criterion Covered Total %
branch 72 106 67.9


line true false branch
60 17 0 if (minimum < r) {
65 0 0 if (r > STRING_MAX_CHARS) {
81 17 50 if (! text_fuzzy->b.unicode) {
86 0 17 get_memory (text_fuzzy->b.unicode,
0 17 get_memory (text_fuzzy->b.unicode,
89 0 50 else if (b_length > text_fuzzy->b_unicode_length) {
97 0 0 Renew (text_fuzzy->b.unicode, text_fuzzy->b_unicode_length, int);
137 82 0 utf = (const U8 *) SvPV (text, length);
139 675 82 for (i = 0; i < tfs->ulength; i++) {
141 675 0 tfs->unicode[i] = (int) utf8_to_uvchr_buf (utf, send, & len);
142 675 0 if (len == -1 || tfs->unicode[i] == 0) {
0 675 if (len == -1 || tfs->unicode[i] == 0) {
164 0 43 get_memory (text_fuzzy, 1, text_fuzzy_t);
168 43 0 stuff = (const unsigned char *) SvPV (text, length);
169 0 43 get_memory (copy, length + 1, char);
170 384 43 for (i = 0; i < (int) length; i++) {
177 15 28 if (is_utf8) {
185 0 15 get_memory (text_fuzzy->text.unicode, text_fuzzy->text.ulength, int);
0 15 get_memory (text_fuzzy->text.unicode, text_fuzzy->text.ulength, int);
187 0 15 TFPCALL(sv_to_int_ptr(text, & text_fuzzy->text));
189 15 0 if (text_fuzzy->text.ulength > 0) {
192 0 15 TEXT_FUZZY (generate_ualphabet (text_fuzzy));
196 26 2 if (text_fuzzy->text.length > 0) {
197 0 26 TEXT_FUZZY (generate_alphabet (text_fuzzy));
200 0 43 TEXT_FUZZY (allocate_edits (text_fuzzy));
210 149 0 text_fuzzy->b.text = SvPV (word, length);
213 124 25 if (SvUTF8 (word) || text_fuzzy->unicode) {
42 82 if (SvUTF8 (word) || text_fuzzy->unicode) {
220 2 65 if (! text_fuzzy->unicode) {
228 0 2 get_memory (nonu, text_fuzzy->b.length + 1, char);
229 7 2 for (i = 0; i < text_fuzzy->b.ulength; i++) {
233 1 6 if (c <= 0x80) {
251 2 147 if (text_fuzzy->b.allocated) {
269 0 42 TEXT_FUZZY (compare_single (text_fuzzy));
271 40 2 if (text_fuzzy->found) {
286 5 12 if (wantarray) {
289 0 17 TEXT_FUZZY (begin_scanning (text_fuzzy));
297 0 17 if (n_words == 0) {
301 107 17 for (i = 0; i < n_words; i++) {
306 0 107 TEXT_FUZZY (compare_single (text_fuzzy));
308 30 77 if (text_fuzzy->found) {
310 20 10 if (! text_fuzzy->wantarray && text_fuzzy->distance == 0) {
0 20 if (! text_fuzzy->wantarray && text_fuzzy->distance == 0) {
323 0 17 TEXT_FUZZY (end_scanning (text_fuzzy));
331 6 11 if (text_fuzzy->wantarray) {
335 0 6 TEXT_FUZZY (get_candidates (text_fuzzy, & n_candidates,
337 3 3 if (n_candidates > 0) {
338 10 3 for (i = 0; i < n_candidates; i++) {
344 0 3 TEXT_FUZZY (free_candidates (text_fuzzy, candidates));
356 17 26 if (text_fuzzy->b.unicode) {
364 0 43 TEXT_FUZZY (free_memory (text_fuzzy));
366 15 28 if (text_fuzzy->unicode) {
374 0 43 if (text_fuzzy->n_mallocs != 1) {