Fix bug causing PloverPackageSet to treat '' and 'file:/' as distinct root URIs
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.
24 #include <plover-gtk/stockicons.h>
26 static void test_basic(void)
29 cwd=g_get_current_dir();
30 g_setenv("PLOVER_ICONS_DATADIR",cwd,TRUE);
32 plover_icons_add_to_stock("mimetypes",
33 "application-x-redhat-package-manager");
34 g_assert(gtk_icon_factory_lookup_default("application-x-redhat-package-manager"));
35 g_unsetenv("PLOVER_ICONS_DATADIR");
38 static void test_no_svg(void)
41 cwd=g_get_current_dir();
42 g_setenv("PLOVER_ICONS_DATADIR",cwd,TRUE);
44 g_setenv("PLOVER_IGNORE_SVG_SUPPORT","yes",TRUE);
45 plover_icons_add_to_stock("mimetypes",
46 "application-x-redhat-package-manager");
47 g_assert(gtk_icon_factory_lookup_default("application-x-redhat-package-manager"));
48 g_unsetenv("PLOVER_IGNORE_SVG_SUPPORT");
49 g_unsetenv("PLOVER_ICONS_DATADIR");
52 static void test_none_existant(void)
54 plover_icons_add_to_stock("mimetypes",
55 "application-x-plover-test-stockicons");
58 int main(int argc,char **argv)
61 gtk_test_init(&argc,&argv,NULL);
62 g_test_bug_base("mailto:ali@juiblex.co.uk");
63 g_test_add_func("/stockicons/basic",test_basic);
64 g_test_add_func("/stockicons/no-svg",test_no_svg);
65 g_test_add_func("/stockicons/non-existant",test_none_existant);