comparison tests/uninorm/test-u32-normalize-big.c @ 40226:5b87a9bf7240

uninorm tests: Free allocated memory. * tests/uninorm/test-u32-normalize-big.h (struct normalization_test_file): Remove 'const' from allocated member. (free_normalization_test_file): New declaration. * tests/uninorm/test-u32-normalize-big.c (test_other): Free allocated memory. (free_normalization_test_file): New function. * tests/uninorm/test-u32-nfc-big.c (main): Free allocated 'struct normalization_test_file' contents. * tests/uninorm/test-u32-nfd-big.c (main): Likewise. * tests/uninorm/test-u32-nfkc-big.c (main): Likewise. * tests/uninorm/test-u32-nfkd-big.c (main): Likewise.
author Bruno Haible <bruno@clisp.org>
date Sun, 10 Mar 2019 15:14:01 +0100
parents b06060465f09
children
comparison
equal deleted inserted replaced
40225:1e0e3e621a8d 40226:5b87a9bf7240
295 uint32_t *result; 295 uint32_t *result;
296 296
297 input[0] = uc; 297 input[0] = uc;
298 result = u32_normalize (nf, input, 1, NULL, &length); 298 result = u32_normalize (nf, input, 1, NULL, &length);
299 ASSERT (result != NULL && length == 1 && result[0] == uc); 299 ASSERT (result != NULL && length == 1 && result[0] == uc);
300 } 300
301 } 301 free (result);
302 }
303 }
304 }
305
306 void
307 free_normalization_test_file (struct normalization_test_file *file)
308 {
309 size_t part_index;
310
311 for (part_index = 0; part_index < 4; part_index++)
312 {
313 const struct normalization_test_part *p = &file->parts[part_index];
314 size_t line_index;
315
316 for (line_index = 0; line_index < p->lines_length; line_index++)
317 {
318 const struct normalization_test_line *l = &p->lines[line_index];
319 size_t sequence_index;
320
321 for (sequence_index = 0; sequence_index < 5; sequence_index++)
322 free (l->sequences[sequence_index]);
323 }
324 free (p->lines);
325 }
326 free (file->part1_c1_sorted);
327 free (file->filename);
302 } 328 }
303 329
304 #endif 330 #endif