20221212
[devspec.git] / devspec.en_US / project / recutils / torture / rec-field / rec-field-location.c
blob8713fbc7dc4dc386e3492a544eb01280fb379956
1 /* -*- mode: C -*-
3 * File: rec-field-location.c
4 * Date: Fri Nov 12 15:01:45 2010
6 * GNU recutils - rec_field_location unit tests.
8 */
10 /* Copyright (C) 2009-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 <string.h>
28 #include <stdlib.h>
29 #include <check.h>
31 #include <rec.h>
33 /*-
34 * Test: rec_field_location_nominal
35 * Unit: rec_field_location
36 * Description:
37 * + Get the location of a field.
39 START_TEST(rec_field_location_nominal)
41 rec_field_t field;
43 field = rec_field_new ("foo", "value");
44 fail_if (field == NULL);
46 fail_if (rec_field_location (field) != 0);
47 rec_field_set_location (field, 100);
48 fail_if (rec_field_location (field) != 100);
50 rec_field_destroy (field);
52 END_TEST
55 * Test creation function
57 TCase *
58 test_rec_field_location (void)
60 TCase *tc = tcase_create ("rec_field_location");
61 tcase_add_test (tc, rec_field_location_nominal);
63 return tc;
66 /* End of rec-field-location.c */