Fri, 27 Apr 2018 17:10:43 -0500
tests: Remove superfluous dbus-server.h includes
Windows doesn't generate dbus-server.h and the includes in these
testcases didn't seem to be used anyway. This patch removes them.
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * Purple is the legal property of its developers, whose names are too |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * numerous to list here. Please refer to the COPYRIGHT file distributed |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * with this source distribution |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or (at |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * your option) any later version. |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, but |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * General Public License for more details. |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include <glib.h> |
|
38426
e35d277efcce
tests: Add missing string.h includes
Mike Ruprecht <cmaiku@gmail.com>
parents:
38297
diff
changeset
|
24 | #include <string.h> |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <purple.h> |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | // generated via: |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | // $ cat test-image.png | hexdump -v -e '1 1 "0x%02x," " "' | xargs -n 8 echo |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | static const gsize test_image_data_len = 160; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | static const guint8 test_image_data[] = { |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | 0x08, 0x02, 0x00, 0x00, 0x00, 0xfd, 0xd4, 0x9a, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | 0x73, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xe0, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | 0x0a, 0x02, 0x16, 0x30, 0x22, 0x28, 0xa4, 0xc9, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | 0xdd, 0x00, 0x00, 0x00, 0x1d, 0x69, 0x54, 0x58, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x72, 0x65, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x64, 0x2e, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | 0x65, 0x07, 0x00, 0x00, 0x00, 0x16, 0x49, 0x44, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0xff, 0xff, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | 0x3f, 0x03, 0x03, 0x03, 0xe3, 0xb3, 0x4c, 0xb5, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | 0x9b, 0x4e, 0x0b, 0x00, 0x2f, 0xa9, 0x06, 0x2f, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | 0x8a, 0xd1, 0xc6, 0xb3, 0x00, 0x00, 0x00, 0x00, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | }; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | /****************************************************************************** |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | * Helpers |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | *****************************************************************************/ |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | static void |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | _test_smiley(PurpleSmiley *smiley, |
|
38567
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
59 | const gchar *path, |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | const guint8 *edata, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | gsize elen, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | const gchar *ext, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | const gchar *mimetype, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | const gchar *shortcut) |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | { |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | GBytes *bytes = NULL; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | const guint8 *adata = NULL; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | gsize alen; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | g_assert(PURPLE_IS_SMILEY(PURPLE_IMAGE(smiley))); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | bytes = purple_image_get_contents(PURPLE_IMAGE(smiley)); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | adata = g_bytes_get_data(bytes, &alen); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | g_assert_cmpmem(adata, alen, edata, elen); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | g_bytes_unref(bytes); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | g_assert_cmpstr( |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | purple_image_get_extension(PURPLE_IMAGE(smiley)), |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | ==, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | ext |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | ); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | g_assert_cmpstr( |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | purple_image_get_mimetype(PURPLE_IMAGE(smiley)), |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | ==, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | mimetype |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | ); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | g_assert_cmpstr(purple_smiley_get_shortcut(smiley), ==, shortcut); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | |
|
38571
faafa2fd8b5a
Fix up a broken unit test
Gary Kramlich <grim@reaperworld.com>
parents:
38570
diff
changeset
|
89 | if(path) |
|
faafa2fd8b5a
Fix up a broken unit test
Gary Kramlich <grim@reaperworld.com>
parents:
38570
diff
changeset
|
90 | g_assert_cmpstr(purple_image_get_path(PURPLE_IMAGE(smiley)), ==, path); |
|
38567
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
91 | |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | g_object_unref(G_OBJECT(smiley)); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | } |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | |
|
38567
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
95 | /****************************************************************************** |
|
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
96 | * Tests |
|
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
97 | *****************************************************************************/ |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | static void |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | test_smiley_new_from_data(void) { |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | PurpleSmiley *smiley = purple_smiley_new_from_data( |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | ":-X", |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | test_image_data, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | test_image_data_len |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | ); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | _test_smiley( |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
107 | smiley, |
|
38571
faafa2fd8b5a
Fix up a broken unit test
Gary Kramlich <grim@reaperworld.com>
parents:
38570
diff
changeset
|
108 | NULL, |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | test_image_data, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | test_image_data_len, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | "png", |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | "image/png", |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | ":-X" |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | ); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | } |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | static void |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | test_smiley_new_from_file(void) { |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | PurpleSmiley *smiley = NULL; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | GError *error = NULL; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | gchar *path = NULL; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | gchar *edata = NULL; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | gsize elen; |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | path = g_build_filename(TEST_DATA_DIR, "test-image.png", NULL); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | smiley = purple_smiley_new("^_^", path); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | g_assert_no_error(error); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | g_file_get_contents(path, &edata, &elen, &error); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | g_assert_no_error(error); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | _test_smiley( |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | smiley, |
|
38567
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
134 | path, |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | (guint8 *)edata, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | elen, |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | "png", |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | "image/png", |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | "^_^" |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | ); |
|
38567
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
141 | |
|
277d8f0ec6f8
This should fix up https://github.com/tieto/sipe/issues/147 as paths for smileys were overlooked
Gary Kramlich <grim@reaperworld.com>
parents:
38297
diff
changeset
|
142 | g_free(path); |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | } |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | /****************************************************************************** |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | * Main |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | *****************************************************************************/ |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | gint |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | main(gint argc, gchar **argv) { |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | g_test_init(&argc, &argv, NULL); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | |
|
38573
e890b91f60fe
Use g_test_set_nonfatal_assertions when available
Gary Kramlich <grim@reaperworld.com>
parents:
38571
diff
changeset
|
152 | #if GLIB_CHECK_VERSION(2, 38, 0) |
|
e890b91f60fe
Use g_test_set_nonfatal_assertions when available
Gary Kramlich <grim@reaperworld.com>
parents:
38571
diff
changeset
|
153 | g_test_set_nonfatal_assertions(); |
|
e890b91f60fe
Use g_test_set_nonfatal_assertions when available
Gary Kramlich <grim@reaperworld.com>
parents:
38571
diff
changeset
|
154 | #endif /* GLIB_CHECK_VERSION(2, 38, 0) */ |
|
e890b91f60fe
Use g_test_set_nonfatal_assertions when available
Gary Kramlich <grim@reaperworld.com>
parents:
38571
diff
changeset
|
155 | |
|
38297
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | g_test_add_func("/smiley/new-from-data", test_smiley_new_from_data); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | g_test_add_func("/smiley/new-from-file", test_smiley_new_from_file); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | return g_test_run(); |
|
55aead831b0e
Add some unit tests for smileys
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | } |