1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility)
4  *
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #include "atk_test_util.h"
24 #include "atk_suite.h"
25 
26 #define DATA_FILE TESTS_DATA_DIR"/test-text.xml"
27 
GHRunc_find(gpointer key,gpointer value,gpointer user_data)28 static gboolean GHRunc_find (gpointer key, gpointer value, gpointer user_data)
29 {
30   if (!g_strcmp0 (key, user_data)) {
31     return TRUE;
32   }
33   return FALSE;
34 }
35 
36 static void
atk_test_text_get_character_count(gpointer fixture,gconstpointer user_data)37 atk_test_text_get_character_count (gpointer fixture, gconstpointer user_data)
38 {
39   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
40   g_assert (_obj);
41   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
42   g_assert (child);
43   AtspiText *obj = atspi_accessible_get_text_iface (child);
44 
45   gint count = atspi_text_get_character_count (obj, NULL);
46   g_assert_cmpint (count, ==, 16);
47 }
48 
49 static void
atk_test_text_get_text(gpointer fixture,gconstpointer user_data)50 atk_test_text_get_text (gpointer fixture, gconstpointer user_data)
51 {
52   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
53   g_assert (_obj);
54   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
55   g_assert (child);
56   AtspiText *obj = atspi_accessible_get_text_iface (child);
57 
58   gchar *text = atspi_text_get_text (obj, 9, 14, NULL);
59   g_assert_cmpstr (text, ==, "works");
60   g_free (text);
61 }
62 
63 static void
atk_test_text_get_caret_offset(gpointer fixture,gconstpointer user_data)64 atk_test_text_get_caret_offset (gpointer fixture, gconstpointer user_data)
65 {
66   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
67   g_assert (_obj);
68   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
69   g_assert (child);
70   AtspiText *obj = atspi_accessible_get_text_iface (child);
71 
72   gint pos = atspi_text_get_caret_offset (obj, NULL);
73   g_assert_cmpint (pos,==,-1);
74 }
75 
76 static void
atk_test_text_set_caret_offset(gpointer fixture,gconstpointer user_data)77 atk_test_text_set_caret_offset (gpointer fixture, gconstpointer user_data)
78 {
79   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
80   g_assert (_obj);
81   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
82   g_assert (child);
83   AtspiText *obj = atspi_accessible_get_text_iface (child);
84 
85   g_assert_true (atspi_text_set_caret_offset (obj, 5, NULL));
86   g_assert_false (atspi_text_set_caret_offset (obj, -1, NULL));
87   gint pos = atspi_text_get_caret_offset (obj, NULL);
88   g_assert_cmpint (pos, ==, 5);
89 }
90 static void
atk_test_text_get_character_at_offset(gpointer fixture,gconstpointer user_data)91 atk_test_text_get_character_at_offset (gpointer fixture, gconstpointer user_data)
92 {
93   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
94   g_assert (_obj);
95   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
96   g_assert (child);
97   AtspiText *obj = atspi_accessible_get_text_iface (child);
98 
99   guint chr = atspi_text_get_character_at_offset (obj, 5, NULL);
100   g_assert_cmpint (chr, ==, 32);
101 }
102 
103 static void
atk_test_text_get_character_extents(gpointer fixture,gconstpointer user_data)104 atk_test_text_get_character_extents (gpointer fixture, gconstpointer user_data)
105 {
106   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
107   g_assert (_obj);
108   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
109   g_assert (child);
110   AtspiText *obj = atspi_accessible_get_text_iface (child);
111 
112   AtspiRect *rec = atspi_text_get_character_extents (obj, 6, ATSPI_COORD_TYPE_SCREEN, NULL);
113   g_assert_cmpint (rec->x, ==, 100);
114   g_assert_cmpint (rec->y, ==, 33);
115   g_assert_cmpint (rec->width, ==, 110);
116   g_assert_cmpint (rec->height, ==, 30);
117 
118   g_free (rec);
119 }
120 
121 static void
atk_test_text_get_range_extents(gpointer fixture,gconstpointer user_data)122 atk_test_text_get_range_extents (gpointer fixture, gconstpointer user_data)
123 {
124   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
125   g_assert (_obj);
126   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
127   g_assert (child);
128   AtspiText *obj = atspi_accessible_get_text_iface (child);
129 
130   AtspiRect *rec = atspi_text_get_range_extents (obj, 0, 1, ATSPI_COORD_TYPE_SCREEN, NULL);
131 
132   g_assert_cmpint (rec->x, ==, 100);
133   g_assert_cmpint (rec->y, ==, 33);
134   g_assert_cmpint (rec->width, ==, 110);
135   g_assert_cmpint (rec->height, ==, 30);
136 
137   g_free (rec);
138 }
139 
140 static void
atk_test_text_add_selection(gpointer fixture,gconstpointer user_data)141 atk_test_text_add_selection (gpointer fixture, gconstpointer user_data)
142 {
143   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
144   g_assert (_obj);
145   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
146   g_assert (child);
147   AtspiText *obj = atspi_accessible_get_text_iface (child);
148 
149   g_assert_true (atspi_text_add_selection (obj, 9, 14, NULL));
150 }
151 
152 static void
atk_test_text_get_n_selections(gpointer fixture,gconstpointer user_data)153 atk_test_text_get_n_selections (gpointer fixture, gconstpointer user_data)
154 {
155   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
156   g_assert (_obj);
157   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
158   g_assert (child);
159   AtspiText *obj = atspi_accessible_get_text_iface (child);
160 
161   gint n = atspi_text_get_n_selections (obj, NULL);
162   g_assert_cmpint (n, ==, 0);
163   g_assert_true (atspi_text_add_selection (obj, 9, 14, NULL));
164   g_assert_true (atspi_text_add_selection (obj, 9, 14, NULL));
165   g_assert_true (atspi_text_add_selection (obj, 9, 14, NULL));
166   n = atspi_text_get_n_selections (obj, NULL);
167   g_assert_cmpint (n, ==, 3);
168 }
169 
170 static void
atk_test_text_get_selection(gpointer fixture,gconstpointer user_data)171 atk_test_text_get_selection (gpointer fixture, gconstpointer user_data)
172 {
173   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
174   g_assert (_obj);
175   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
176   g_assert (child);
177   AtspiText *obj = atspi_accessible_get_text_iface (child);
178 
179   g_assert_true (atspi_text_add_selection (obj, 9, 14, NULL));
180   g_assert_true (atspi_text_add_selection (obj, 14, 15, NULL));
181 
182   AtspiRange *range = atspi_text_get_selection (obj, 0, NULL);
183   g_assert (range);
184   g_assert_cmpint (range->start_offset, ==, 9);
185   g_assert_cmpint (range->end_offset, ==, 14);
186   g_free (range);
187 
188   range = atspi_text_get_selection (obj, 1, NULL);
189   g_assert (range);
190   g_assert_cmpint (range->start_offset, ==, 14);
191   g_assert_cmpint (range->end_offset, ==, 15);
192   g_free (range);
193 }
194 
195 static void
atk_test_text_set_selection(gpointer fixture,gconstpointer user_data)196 atk_test_text_set_selection (gpointer fixture, gconstpointer user_data)
197 {
198   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
199   g_assert (_obj);
200   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
201   g_assert (child);
202   AtspiText *obj = atspi_accessible_get_text_iface (child);
203 
204   g_assert_true(atspi_text_add_selection (obj, 9, 14, NULL));
205   g_assert_true(atspi_text_add_selection (obj, 14, 15, NULL));
206   g_assert_true(atspi_text_set_selection (obj, 0, 1, 2, NULL));
207   g_assert_true(atspi_text_set_selection (obj, 1, 3, 4, NULL));
208 
209   AtspiRange *range = atspi_text_get_selection (obj, 0, NULL);
210   g_assert (range);
211   g_assert_cmpint (range->start_offset, ==, 1);
212   g_assert_cmpint (range->end_offset, ==, 2);
213   g_free (range);
214 
215   range = atspi_text_get_selection (obj, 1, NULL);
216   g_assert (range);
217   g_assert_cmpint (range->start_offset, ==, 3);
218   g_assert_cmpint (range->end_offset, ==, 4);
219   g_free (range);
220 }
221 
222 static void
atk_test_text_remove_selection(gpointer fixture,gconstpointer user_data)223 atk_test_text_remove_selection (gpointer fixture, gconstpointer user_data)
224 {
225   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
226   g_assert (_obj);
227   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
228   g_assert (child);
229   AtspiText *obj = atspi_accessible_get_text_iface (child);
230 
231   gint n = atspi_text_get_n_selections (obj, NULL);
232   g_assert_cmpint (n, ==, 0);
233 
234   g_assert_true (atspi_text_add_selection (obj, 9, 14, NULL));
235   g_assert_true (atspi_text_add_selection (obj, 14, 15, NULL));
236   n = atspi_text_get_n_selections (obj, NULL);
237   g_assert_cmpint (n, ==, 2);
238 
239   g_assert_true (atspi_text_remove_selection (obj, 1, NULL));
240   n = atspi_text_get_n_selections (obj, NULL);
241   g_assert_cmpint (n, ==, 1);
242 
243   g_assert_true (atspi_text_remove_selection (obj, 0, NULL));
244   n = atspi_text_get_n_selections (obj, NULL);
245   g_assert_cmpint (n, ==, 0);
246 }
247 
248 static void
atk_test_text_get_offset_at_point(gpointer fixture,gconstpointer user_data)249 atk_test_text_get_offset_at_point (gpointer fixture, gconstpointer user_data)
250 {
251   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
252   g_assert (_obj);
253   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
254   g_assert (child);
255   AtspiText *obj = atspi_accessible_get_text_iface (child);
256 
257   gint n = atspi_text_get_offset_at_point (obj, 0, 0, ATSPI_COORD_TYPE_SCREEN, NULL);
258   g_assert_cmpint (n, ==, 5);
259 }
260 
261 static void
atk_test_text_get_text_attribute_value(gpointer fixture,gconstpointer user_data)262 atk_test_text_get_text_attribute_value (gpointer fixture, gconstpointer user_data)
263 {
264   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
265   g_assert (_obj);
266   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
267   g_assert (child);
268   AtspiText *obj = atspi_accessible_get_text_iface (child);
269 
270   GError *err = NULL;
271   gchar *str = atspi_text_get_text_attribute_value (obj, 0, "text_test_attr1", &err);
272   if (err)
273     g_print ("error msg:%s\n", err->message);
274   g_assert (str);
275   g_assert_cmpstr (str, ==, "on");
276   g_free (str);
277 
278   str = atspi_text_get_text_attribute_value (obj, 0, "text_test_attr2", NULL);
279   g_assert (str);
280   g_assert_cmpstr (str, ==, "off");
281   g_free (str);
282 }
283 
284 static void
atk_test_text_get_attribute_run(gpointer fixture,gconstpointer user_data)285 atk_test_text_get_attribute_run (gpointer fixture, gconstpointer user_data)
286 {
287   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
288   g_assert (_obj);
289   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
290   g_assert (child);
291   AtspiText *obj = atspi_accessible_get_text_iface (child);
292 
293   gint start_offset = 0;
294   gint end_offset = 0;
295   GHashTable *tab =  atspi_text_get_attribute_run (obj, 0, FALSE, &start_offset, &end_offset , NULL);
296 
297   g_assert (tab);
298 
299   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "text_test_attr1"), ==, "on");
300   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "text_test_attr2"), ==, "off");
301   g_assert_cmpint (start_offset, == , 5);
302   g_assert_cmpint (end_offset, == , 10);
303   g_hash_table_destroy (tab);
304 }
305 
306 static void
atk_test_text_get_defualt_attributes(gpointer fixture,gconstpointer user_data)307 atk_test_text_get_defualt_attributes (gpointer fixture, gconstpointer user_data)
308 {
309   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
310   g_assert (_obj);
311   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
312   g_assert (child);
313   AtspiText *obj = atspi_accessible_get_text_iface (child);
314 
315   GHashTable *tab = atspi_text_get_default_attributes (obj, NULL);
316   g_assert (tab);
317 
318   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "bold_text"), ==, "on");
319   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "underline_text"), ==, "off");
320   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "dummy_text"), ==, "");
321   g_hash_table_destroy (tab);
322 }
323 
324 static void
atk_test_text_get_text_attributes(gpointer fixture,gconstpointer user_data)325 atk_test_text_get_text_attributes (gpointer fixture, gconstpointer user_data)
326 {
327   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
328   g_assert (_obj);
329   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
330   g_assert (child);
331   AtspiText *obj = atspi_accessible_get_text_iface (child);
332 
333   gint start_offset = 0;
334   gint end_offset = 0;
335   GHashTable *tab =  atspi_text_get_text_attributes (obj, 0, &start_offset, &end_offset, NULL);
336 
337   g_assert (tab);
338 
339   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "text_test_attr1"), ==, "on");
340   g_assert_cmpstr ((const char*) g_hash_table_find (tab, GHRunc_find, "text_test_attr2"), ==, "off");
341   g_assert_cmpint (start_offset, == , 5);
342   g_assert_cmpint (end_offset, == , 10);
343   g_hash_table_destroy (tab);
344 }
345 
346 static void
atk_test_text_get_string_at_offset_s1(gpointer fixture,gconstpointer user_data)347 atk_test_text_get_string_at_offset_s1 (gpointer fixture, gconstpointer user_data)
348 {
349   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
350   g_assert (_obj);
351   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
352   g_assert (child);
353   AtspiText *obj = atspi_accessible_get_text_iface (child);
354 
355   AtspiTextRange *range = atspi_text_get_string_at_offset (obj, 0, ATSPI_TEXT_GRANULARITY_CHAR, NULL);
356 
357   g_assert_cmpint (range->start_offset, ==, 0);
358   g_assert_cmpint (range->end_offset, ==, 1);
359   g_assert_cmpstr (range->content, ==, "t");
360 
361   g_free (range);
362 
363   range = atspi_text_get_string_at_offset (obj, 5, ATSPI_TEXT_GRANULARITY_WORD, NULL);
364 
365   g_assert_cmpint (range->start_offset, ==, 6);
366   g_assert_cmpint (range->end_offset, ==, 7);
367   g_assert_cmpstr (range->content, ==, "it");
368 
369   g_free (range);
370 }
371 static void
atk_test_text_get_string_at_offset_s2(gpointer fixture,gconstpointer user_data)372 atk_test_text_get_string_at_offset_s2 (gpointer fixture, gconstpointer user_data)
373 {
374   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
375   g_assert (_obj);
376   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 1, NULL);
377   g_assert (child);
378   AtspiText *obj = atspi_accessible_get_text_iface (child);
379 
380   AtspiTextRange *range = atspi_text_get_string_at_offset (obj, 20, ATSPI_TEXT_GRANULARITY_SENTENCE, NULL);
381 
382   g_assert_cmpint (range->start_offset, ==, 18);
383   g_assert_cmpint (range->end_offset, ==, 34);
384   g_assert_cmpstr (range->content, ==, "Second sentence.");
385 
386   g_free (range);
387 
388   range = atspi_text_get_string_at_offset (obj, 21, ATSPI_TEXT_GRANULARITY_LINE, NULL);
389 
390   g_assert_cmpint (range->start_offset, ==, 18);
391   g_assert_cmpint (range->end_offset, ==, 34);
392   g_assert_cmpstr (range->content, ==, "Second sentence.");
393 
394   g_free (range);
395 
396   range = atspi_text_get_string_at_offset (obj, 0, ATSPI_TEXT_GRANULARITY_PARAGRAPH, NULL);
397 
398   g_assert_cmpint (range->start_offset, ==, 0);
399   g_assert_cmpint (range->end_offset, ==, 0);
400   g_assert_cmpstr (range->content, ==, "");
401 
402   g_free (range);
403 }
404 
405 static void
atk_test_text_get_bounded_ranges(gpointer fixture,gconstpointer user_data)406 atk_test_text_get_bounded_ranges (gpointer fixture, gconstpointer user_data)
407 {
408   AtspiAccessible *_obj = get_root_obj (DATA_FILE);
409   g_assert (_obj);
410   AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL);
411   g_assert (child);
412   AtspiText *obj = atspi_accessible_get_text_iface (child);
413 
414   GArray *array = atspi_text_get_bounded_ranges (obj, 15, 21, 100, 50, ATSPI_COORD_TYPE_SCREEN, ATSPI_TEXT_CLIP_MAX, ATSPI_TEXT_CLIP_MIN, NULL);
415   g_assert (array);
416 
417   AtspiTextRange *range  = &g_array_index (array, AtspiTextRange, 0);
418   g_assert_cmpint (g_array_get_element_size (array), ==, sizeof (AtspiTextRange));
419   g_assert_cmpint (range->start_offset, ==, 0);
420   g_assert_cmpint (range->end_offset, ==, 5);
421   g_assert_cmpstr (range->content, ==, "text0");
422 
423   range  = &g_array_index (array, AtspiTextRange, 1);
424   g_assert_cmpint (g_array_get_element_size (array), ==, sizeof (AtspiTextRange));
425   g_assert_cmpint (range->start_offset, ==, 6);
426   g_assert_cmpint (range->end_offset, ==, 10);
427   g_assert_cmpstr (range->content, ==, "it w");
428 
429   g_array_free (array,TRUE);
430 }
431 
432 static void
teardown_text_test(gpointer fixture,gconstpointer user_data)433 teardown_text_test (gpointer fixture, gconstpointer user_data)
434 {
435   terminate_app ();
436 }
437 
438 void
atk_test_text(void)439 atk_test_text (void)
440 {
441   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_count",
442                      0, NULL, NULL, atk_test_text_get_character_count, teardown_text_test);
443   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_text",
444                      0, NULL, NULL, atk_test_text_get_text, teardown_text_test);
445   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_caret_offset",
446                      0, NULL, NULL, atk_test_text_get_caret_offset, teardown_text_test);
447   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_text_attributes",
448                      0, NULL, NULL, atk_test_text_get_text_attributes, teardown_text_test);
449   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_attribute_run",
450                      0, NULL, NULL, atk_test_text_get_attribute_run, teardown_text_test);
451   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_text_attribute_value",
452                      0, NULL, NULL, atk_test_text_get_text_attribute_value, teardown_text_test);
453   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_defualt_attributes",
454                      0, NULL, NULL, atk_test_text_get_defualt_attributes, teardown_text_test);
455   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_set_caret_offset",
456                      0, NULL, NULL, atk_test_text_set_caret_offset, teardown_text_test);
457   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_string_at_offset_s1",
458                      0, NULL, NULL, atk_test_text_get_string_at_offset_s1, teardown_text_test );
459   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_string_at_offset_s2",
460                      0, NULL, NULL, atk_test_text_get_string_at_offset_s2, teardown_text_test );
461   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_at_offset",
462                      0, NULL, NULL, atk_test_text_get_character_at_offset, teardown_text_test);
463   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_extents",
464                      0, NULL, NULL, atk_test_text_get_character_extents, teardown_text_test);
465   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_offset_at_point",
466                      0, NULL, NULL, atk_test_text_get_offset_at_point, teardown_text_test);
467   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_range_extents",
468                      0, NULL, NULL, atk_test_text_get_range_extents, teardown_text_test);
469   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_bounded_ranges",
470                      0, NULL, NULL, atk_test_text_get_bounded_ranges, teardown_text_test);
471   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_n_selections",
472                      0, NULL, NULL, atk_test_text_get_n_selections, teardown_text_test);
473   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_selection",
474                      0, NULL, NULL, atk_test_text_get_selection, teardown_text_test);
475   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_add_selection",
476                      0, NULL, NULL, atk_test_text_add_selection, teardown_text_test );
477   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_remove_selection",
478                      0, NULL, NULL, atk_test_text_remove_selection, teardown_text_test );
479   g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_set_selection",
480                      0, NULL, NULL, atk_test_text_set_selection, teardown_text_test);
481 }
482