20221212
[devspec.git] / devspec.en_US / project / recutils / torture / rec-field-name / rec-field-name-p.c
blobc09ffbedd3632aca5fde7e489b16b67190397404
1 /* -*- mode: C -*-
3 * File: rec-field-name-p.c
4 * Date: Fri Oct 29 15:26:11 2010
6 * GNU recutils - rec_field_name_part_str_p unit tests.
8 */
10 /* Copyright (C) 2010-2015 Jose E. Marchesi */
12 /* This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #include <config.h>
27 #include <check.h>
29 #include <rec.h>
31 /*-
32 * Test: rec_field_name_p_nominal
33 * Unit: rec_field_name_p
34 * Description:
35 * + Check field name parts.
37 START_TEST(rec_field_name_part_str_p_nominal)
39 fail_if (rec_field_name_p (""));
40 fail_if (rec_field_name_p (":"));
41 fail_if (rec_field_name_p ("-x"));
42 fail_if (rec_field_name_p ("_x"));
43 fail_if (rec_field_name_p ("0x"));
44 fail_if (rec_field_name_p ("x%"));
45 fail_if (!rec_field_name_p ("%"));
46 fail_if (!rec_field_name_p ("ax"));
47 fail_if (!rec_field_name_p ("Ax"));
49 END_TEST
52 * Test case creation function
54 TCase *
55 test_rec_field_name_p (void)
57 TCase *tc = tcase_create ("rec_field_name_part_str_p");
58 tcase_add_test (tc, rec_field_name_part_str_p_nominal);
60 return tc;
64 /* End of rec-field-name-part-str-p.c */