first version upgrade
[devspec.git] / devspec.en_US / project / recutils / torture / rec-field / rec-field-set-source.c
blob6f723770eff6613b716da7b310e384391a114a28
1 /* -*- mode: C -*-
3 * File: rec-field-set-source.c
4 * Date: Fri Nov 12 14:56:51 2010
6 * GNU recutils - rec_field_set_source 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 <check.h>
30 #include <rec.h>
32 /*-
33 * Test: rec_field_set_source_nominal
34 * Unit: rec_field_set_source
35 * Description:
36 * + Set the source of a field.
38 START_TEST(rec_field_set_source_nominal)
40 rec_field_t field;
42 field = rec_field_new ("foo", "value");
43 fail_if (field == NULL);
45 rec_field_set_source (field, "source");
46 fail_if (strcmp (rec_field_source (field), "source") != 0);
48 rec_field_destroy (field);
50 END_TEST
53 * Test creation function
55 TCase *
56 test_rec_field_set_source (void)
58 TCase *tc = tcase_create ("rec_field_set_source");
59 tcase_add_test (tc, rec_field_set_source_nominal);
61 return tc;
64 /* End of rec-field-set-source.c */