Wed, 26 Mar 2014 14:24:19 +0100
Add testsuite for PurpleTrie and fix found bugs
|
35663
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
1 | #include <string.h> |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
2 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
3 | #include "tests.h" |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
4 | #include "../trie.h" |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
5 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
6 | static gboolean |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
7 | test_trie_replace_cb(GString *out, const gchar *word, gpointer word_data, |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
8 | gpointer user_data) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
9 | { |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
10 | /* the "test" word */ |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
11 | if ((int)word_data == 0x1001) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
12 | return FALSE; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
13 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
14 | g_string_append_printf(out, "[%d:%x]", (int)user_data, (int)word_data); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
15 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
16 | return TRUE; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
17 | } |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
18 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
19 | START_TEST(test_trie_replace) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
20 | { |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
21 | PurpleTrie *trie; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
22 | const gchar *in; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
23 | gchar *out; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
24 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
25 | trie = purple_trie_new(); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
26 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
27 | purple_trie_add(trie, "test", (gpointer)0x1001); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
28 | purple_trie_add(trie, "testing", (gpointer)0x1002); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
29 | purple_trie_add(trie, "overtested", (gpointer)0x1003); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
30 | purple_trie_add(trie, "trie", (gpointer)0x1004); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
31 | purple_trie_add(trie, "tree", (gpointer)0x1005); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
32 | purple_trie_add(trie, "implement", (gpointer)0x1006); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
33 | purple_trie_add(trie, "implementation", (gpointer)0x1007); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
34 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
35 | in = "Alice is testing her trie implementation, " |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
36 | "but she's far away from making test tree overtested"; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
37 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
38 | out = purple_trie_replace(trie, in, test_trie_replace_cb, (gpointer)7); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
39 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
40 | assert_string_equal("Alice is [7:1002] her [7:1004] [7:1006]ation," |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
41 | " but she's far away from making test [7:1005] [7:1003]", out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
42 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
43 | g_object_unref(trie); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
44 | g_free(out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
45 | } |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
46 | END_TEST |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
47 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
48 | START_TEST(test_trie_replace_whole) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
49 | { |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
50 | PurpleTrie *trie; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
51 | const gchar *in; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
52 | gchar *out; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
53 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
54 | trie = purple_trie_new(); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
55 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
56 | purple_trie_add(trie, "test", (gpointer)0x2002); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
57 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
58 | in = "test"; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
59 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
60 | out = purple_trie_replace(trie, in, test_trie_replace_cb, (gpointer)5); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
61 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
62 | assert_string_equal("[5:2002]", out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
63 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
64 | g_object_unref(trie); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
65 | g_free(out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
66 | } |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
67 | END_TEST |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
68 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
69 | START_TEST(test_trie_replace_inner) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
70 | { |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
71 | PurpleTrie *trie; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
72 | const gchar *in; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
73 | gchar *out; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
74 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
75 | trie = purple_trie_new(); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
76 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
77 | purple_trie_add(trie, "est", (gpointer)0x3001); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
78 | purple_trie_add(trie, "tester", (gpointer)0x3002); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
79 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
80 | in = "the test!"; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
81 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
82 | out = purple_trie_replace(trie, in, test_trie_replace_cb, (gpointer)3); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
83 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
84 | assert_string_equal("the t[3:3001]!", out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
85 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
86 | g_object_unref(trie); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
87 | g_free(out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
88 | } |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
89 | END_TEST |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
90 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
91 | START_TEST(test_trie_replace_empty) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
92 | { |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
93 | PurpleTrie *trie; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
94 | const gchar *in; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
95 | gchar *out; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
96 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
97 | trie = purple_trie_new(); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
98 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
99 | purple_trie_add(trie, "", (gpointer)0x4001); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
100 | purple_trie_add(trie, "test", (gpointer)0x4002); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
101 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
102 | in = "the test!"; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
103 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
104 | out = purple_trie_replace(trie, in, test_trie_replace_cb, (gpointer)2); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
105 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
106 | assert_string_equal("[2:4001][2:4001][2:4001][2:4001][2:4001][2:4001]" |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
107 | "[2:4001][2:4001][2:4001]", out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
108 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
109 | g_object_unref(trie); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
110 | g_free(out); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
111 | } |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
112 | END_TEST |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
113 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
114 | Suite * |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
115 | purple_trie_suite(void) |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
116 | { |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
117 | Suite *s = suite_create("PurpleTrie class"); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
118 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
119 | TCase *tc = tcase_create("trie"); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
120 | tcase_add_test(tc, test_trie_replace); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
121 | tcase_add_test(tc, test_trie_replace_whole); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
122 | tcase_add_test(tc, test_trie_replace_inner); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
123 | tcase_add_test(tc, test_trie_replace_empty); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
124 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
125 | suite_add_tcase(s, tc); |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
126 | |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
127 | return s; |
|
6527214c491e
Add testsuite for PurpleTrie and fix found bugs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
diff
changeset
|
128 | } |