summaryrefslogtreecommitdiff
path: root/auto_tests/messenger_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'auto_tests/messenger_test.c')
-rw-r--r--auto_tests/messenger_test.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c
index deed498f..cc624ab6 100644
--- a/auto_tests/messenger_test.c
+++ b/auto_tests/messenger_test.c
@@ -62,16 +62,16 @@ END_TEST
62START_TEST(test_m_get_userstatus_size) 62START_TEST(test_m_get_userstatus_size)
63{ 63{
64 int rc = 0; 64 int rc = 0;
65 ck_assert_msg((m_get_userstatus_size(-1) == -1), 65 ck_assert_msg((m_get_statusmessage_size(-1) == -1),
66 "m_get_userstatus_size did NOT catch an argument of -1"); 66 "m_get_statusmessage_size did NOT catch an argument of -1");
67 ck_assert_msg((m_get_userstatus_size(REALLY_BIG_NUMBER) == -1), 67 ck_assert_msg((m_get_statusmessage_size(REALLY_BIG_NUMBER) == -1),
68 "m_get_userstatus_size did NOT catch the following argument: %d\n", 68 "m_get_statusmessage_size did NOT catch the following argument: %d\n",
69 REALLY_BIG_NUMBER); 69 REALLY_BIG_NUMBER);
70 rc = m_get_userstatus_size(friend_id_num); 70 rc = m_get_statusmessage_size(friend_id_num);
71 71
72 /* this WILL error if the original m_addfriend_norequest() failed */ 72 /* this WILL error if the original m_addfriend_norequest() failed */
73 ck_assert_msg((rc > 0 && rc <= MAX_USERSTATUS_LENGTH), 73 ck_assert_msg((rc > 0 && rc <= MAX_STATUSMESSAGE_LENGTH),
74 "m_get_userstatus_size is returning out of range values!\n" 74 "m_get_statusmessage_size is returning out of range values!\n"
75 "(this can be caused by the error of m_addfriend_norequest" 75 "(this can be caused by the error of m_addfriend_norequest"
76 " in the beginning of the suite)\n"); 76 " in the beginning of the suite)\n");
77} 77}
@@ -83,15 +83,13 @@ START_TEST(test_m_set_userstatus)
83 uint16_t good_length = strlen(status); 83 uint16_t good_length = strlen(status);
84 uint16_t bad_length = REALLY_BIG_NUMBER; 84 uint16_t bad_length = REALLY_BIG_NUMBER;
85 85
86 if(m_set_userstatus(USERSTATUS_KIND_ONLINE, 86 if(m_set_statusmessage((uint8_t *)status, bad_length) != -1)
87 (uint8_t *)status, bad_length) != -1)
88 ck_abort_msg("m_set_userstatus did NOT catch the following length: %d\n", 87 ck_abort_msg("m_set_userstatus did NOT catch the following length: %d\n",
89 REALLY_BIG_NUMBER); 88 REALLY_BIG_NUMBER);
90 89
91 if((m_set_userstatus(USERSTATUS_KIND_RETAIN, 90 if((m_set_statusmessage((uint8_t *)status, good_length)) != 0)
92 (uint8_t *)status, good_length)) != 0)
93 ck_abort_msg("m_set_userstatus did NOT return 0 on the following length: %d\n" 91 ck_abort_msg("m_set_userstatus did NOT return 0 on the following length: %d\n"
94 "MAX_USERSTATUS_LENGTH: %d\n", good_length, MAX_USERSTATUS_LENGTH); 92 "MAX_STATUSMESSAGE_LENGTH: %d\n", good_length, MAX_STATUSMESSAGE_LENGTH);
95} 93}
96END_TEST 94END_TEST
97 95