Fri, 04 Sep 2009 06:23:41 +0000
Add a test for qq's qq_encrypt function. Refs #10191. The string of
length 7 demonstrates the bug: 7+16=23, but the qq_encrypt function
at least thinks that it is writing 24 bytes
| 15104 | 1 | #ifndef TESTS_H |
| 2 | # define TESTS_H | |
| 3 | ||
|
21919
9be7eb0e891c
A couple compile fixes to the tests from Elliott Sales de Andrade. Fixes #4313.
Daniel Atallah <datallah@pidgin.im>
parents:
15950
diff
changeset
|
4 | #include "../purple.h" |
|
9be7eb0e891c
A couple compile fixes to the tests from Elliott Sales de Andrade. Fixes #4313.
Daniel Atallah <datallah@pidgin.im>
parents:
15950
diff
changeset
|
5 | |
| 15104 | 6 | #include <check.h> |
| 7 | ||
| 8 | /* define the test suites here */ | |
|
15867
27d45557637d
libpurplify the 'make check' tests so they work again
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15435
diff
changeset
|
9 | /* remember to add the suite to the runner in check_libpurple.c */ |
|
15950
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15867
diff
changeset
|
10 | Suite * master_suite(void); |
| 15154 | 11 | Suite * cipher_suite(void); |
| 12 | Suite * jabber_jutil_suite(void); | |
|
28490
fdf38a8ff87e
Add a test for qq's qq_encrypt function. Refs #10191. The string of
Mark Doliner <markdoliner@pidgin.im>
parents:
28013
diff
changeset
|
13 | Suite * qq_suite(void); |
|
28013
cb4d0ca2e550
Add a super simple test for yahoo_codes_to_html(). I'm planning on
Mark Doliner <markdoliner@pidgin.im>
parents:
21919
diff
changeset
|
14 | Suite * yahoo_util_suite(void); |
| 15104 | 15 | Suite * util_suite(void); |
| 16 | ||
| 17 | /* helper macros */ | |
|
28490
fdf38a8ff87e
Add a test for qq's qq_encrypt function. Refs #10191. The string of
Mark Doliner <markdoliner@pidgin.im>
parents:
28013
diff
changeset
|
18 | #define assert_int_equal(expected, actual) { \ |
|
fdf38a8ff87e
Add a test for qq's qq_encrypt function. Refs #10191. The string of
Mark Doliner <markdoliner@pidgin.im>
parents:
28013
diff
changeset
|
19 | fail_if(expected != actual, "Expecting '%d' but got '%d'", expected, actual); \ |
|
fdf38a8ff87e
Add a test for qq's qq_encrypt function. Refs #10191. The string of
Mark Doliner <markdoliner@pidgin.im>
parents:
28013
diff
changeset
|
20 | } |
|
fdf38a8ff87e
Add a test for qq's qq_encrypt function. Refs #10191. The string of
Mark Doliner <markdoliner@pidgin.im>
parents:
28013
diff
changeset
|
21 | |
| 15104 | 22 | #define assert_string_equal(expected, actual) { \ |
| 23 | const gchar *a = actual; \ | |
| 24 | fail_unless(strcmp(expected, a) == 0, "Expecting '%s' but got '%s'", expected, a); \ | |
| 25 | } | |
| 26 | ||
| 27 | #define assert_string_equal_free(expected, actual) { \ | |
| 15107 | 28 | gchar *b = actual; \ |
| 29 | assert_string_equal(expected, b); \ | |
| 30 | g_free(b); \ | |
| 15104 | 31 | } |
| 32 | ||
| 33 | ||
| 34 | #endif /* ifndef TESTS_H */ | |
| 35 |