2 * Copyright (C) 2016 J. Ali Harlow <ali@juiblex.co.uk>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <plover/plover.h>
23 static void test_basic(void)
26 comps=plover_comps_new();
28 plover_comps_free(comps);
31 static void test_from_file(void)
34 struct comps_group *group;
36 s=g_build_filename(g_getenv("tests_srcdir"),"comps.xml",NULL);
37 comps=plover_comps_new_from_file(s);
39 g_error("%s: Failed to read components",s);
41 group=plover_comps_lookup_group(comps,"base");
43 g_assert(!plover_comps_lookup_group(comps,"nonexistant"));
44 plover_comps_free(comps);
47 int main(int argc,char **argv)
50 g_test_init(&argc,&argv,NULL);
51 g_test_bug_base("mailto:ali@juiblex.co.uk");
52 g_test_add_func("/comps/basic",test_basic);
53 g_test_add_func("/comps/from-file",test_from_file);