Support parallel installations. The idea is that for CAD screener, we want
to be able to install this on the same machine as a standard AVOT setup
(most notably for John's laptop). To allow for the possibility of a second
application that might have the same requirements, we add the concept of
vendor-specific distributions. Thus we can have one distribution for CAD
screener and one for The Next Big Thing. It doesn't seem trivial to have
both CAD screener and AVOT under the same vendor tag so we'll have to have
AVOT under "City Occupational" and CAD screener under "City Occupational Ltd"
or some such kludge.
Most of this is done although we are very short of test cases (in particular
we don't test that it's actually possible to install CAD screener in parallel
with AVOT or to update either of them once installed, which is fundamental).
We also have a lot of baggage left over, including an intercept of razor_set.
The problem that this was introduced to debug has been fixed but it looks
like there are a number of memory leaks which it might be useful to help
track down so it has been left in place for now.
There is still a lot of confusion in plover between path-based and URI-based
API. We should review the API, decide what we want and have a general clear up.
There is also confusion as to the purpose of RAZOR_ROOT (and meaning; path or
URI). This is not used at all in librazor (although it is used in razor.exe).
Ideally we shouldn't use it in plover or plover-gtk either although again, we
might want to support it or an equivalent in (some of) the various executables.
Work that would still to nice to do for CAD screener:
- uninstall (ideally as an installed program that hooks into Add/Remove programs
but even re-running the installer would be acceptable).
- xz support (smaller packages).
- repomd.xml and xml:base (would be needed for an Internet installer).
- graphical installer.
2 * Copyright (C) 2011, 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 static void test_tree_model_iter(GtkTreeModel *model,GtkTreeIter *iter)
26 GtkTreePath *path,*path2;
27 GtkTreeIter iter2,child;
28 gchar *string,*string2,*s;
30 if (iter) /* Not all tests make sense on the virtual root */
32 /* Check we can convert to a path and back */
33 path=gtk_tree_model_get_path(model,iter);
35 g_assert(gtk_tree_model_get_iter(model,&iter2,path));
36 path2=gtk_tree_model_get_path(model,&iter2);
37 g_assert(path2!=NULL);
38 g_assert(gtk_tree_path_compare(path,path2)==0);
39 gtk_tree_path_free(path2);
40 /* Check we can convert to a path string and back */
41 string=gtk_tree_model_get_string_from_iter(model,iter);
42 g_assert(string!=NULL);
43 g_assert(gtk_tree_model_get_iter_from_string(model,&iter2,string));
44 string2=gtk_tree_model_get_string_from_iter(model,&iter2);
45 g_assert(string2!=NULL);
46 g_assert(strcmp(string,string2)==0);
55 g_debug("Checking iter %s",string);
57 g_debug("Checking virtual root iter");
58 n=gtk_tree_model_iter_n_children(model,iter);
62 /* Check that GTK_TREE_MODEL_LIST_ONLY is not set inappropriately */
65 gboolean list_only_with_grandchildren;
66 list_only_with_grandchildren=
67 gtk_tree_model_get_flags(model)>K_TREE_MODEL_LIST_ONLY;
68 g_assert(!list_only_with_grandchildren);
70 /* Check that gtk_tree_model_iter_has_child() agrees */
72 g_assert(gtk_tree_model_iter_has_child(model,iter));
73 /* Check that gtk_tree_model_iter_children() returns the first child */
74 g_assert(gtk_tree_model_iter_children(model,&child,iter));
75 string2=gtk_tree_model_get_string_from_iter(model,&child);
76 g_assert(string2!=NULL);
79 g_assert(g_str_has_prefix(string2,string));
80 g_assert(strlen(string2)==strlen(string)+2);
81 g_assert(g_str_has_suffix(string2,":0"));
84 g_assert(strcmp(string2,"0")==0);
89 * Check that gtk_tree_model_iter_nth_child() returns the nth child
91 g_assert(gtk_tree_model_iter_nth_child(model,&child,iter,i));
92 string2=gtk_tree_model_get_string_from_iter(model,&child);
93 g_assert(string2!=NULL);
95 s=g_strdup_printf("%s:%d",string,i);
97 s=g_strdup_printf("%d",i);
98 g_assert(strcmp(string2,s)==0);
101 /* Check that my son's father is me */
104 g_assert(gtk_tree_model_iter_parent(model,&iter2,&child));
105 string2=gtk_tree_model_get_string_from_iter(model,&iter2);
106 g_assert(strcmp(string,string2)==0);
110 g_assert(!gtk_tree_model_iter_parent(model,&iter2,&child));
111 /* Check next sibling */
115 g_assert(gtk_tree_model_iter_next(model,&iter2));
116 string2=gtk_tree_model_get_string_from_iter(model,&iter2);
117 g_assert(string2!=NULL);
119 s=g_strdup_printf("%s:%d",string,i+1);
121 s=g_strdup_printf("%d",i+1);
122 g_assert(strcmp(string2,s)==0);
129 g_assert(!gtk_tree_model_iter_next(model,&iter2));
132 test_tree_model_iter(model,&child);
135 * Check that gtk_tree_model_iter_nth_child() returns no more children
137 g_assert(!gtk_tree_model_iter_nth_child(model,&child,iter,n));
141 /* Check that all APIs agree that iter has no children */
143 g_assert(!gtk_tree_model_iter_has_child(model,iter));
144 g_assert(!gtk_tree_model_iter_children(model,&child,iter));
145 g_assert(!gtk_tree_model_iter_nth_child(model,&child,iter,0));
147 gtk_tree_path_free(path);
151 void test_tree_model(GtkTreeModel *model)
153 GtkTreeModelFlags undefined_flags;
154 undefined_flags=gtk_tree_model_get_flags(model);
155 undefined_flags&=~GTK_TREE_MODEL_ITERS_PERSIST;
156 undefined_flags&=~GTK_TREE_MODEL_LIST_ONLY;
157 g_assert(!undefined_flags);
158 test_tree_model_iter(model,NULL);