diff options
author | James Booth <boothj5@gmail.com> | 2012-10-03 23:47:10 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-10-03 23:47:10 +0100 |
commit | f8de28232e353794617e402dc0ebf05b57728cc5 (patch) | |
tree | 3f408360f1848c182e07eea14949f9c37a4901c3 /tests | |
parent | cf211be2214d86c5709b407d8ec1691740ee0a5c (diff) | |
download | profani-tty-f8de28232e353794617e402dc0ebf05b57728cc5.tar.gz |
Started work on chat session, and chat states
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_chat_session.c | 25 | ||||
-rw-r--r-- | tests/testsuite.c | 1 | ||||
-rw-r--r-- | tests/testsuite.h | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_chat_session.c b/tests/test_chat_session.c new file mode 100644 index 00000000..7c513fc7 --- /dev/null +++ b/tests/test_chat_session.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <head-unit.h> +#include "chat_session.h" + +void can_init(void) +{ + chat_session_init(); + assert_true(1); +} + +void adding_new_sets_state_to_active(void) +{ + chat_session_init(); + chat_session_new("prof1@panesar"); + ChatSession session = chat_session_get("prof1@panesar"); + + assert_int_equals(ACTIVE, chat_session_get_state(session)); +} + +void register_chat_session_tests(void) +{ + TEST_MODULE("chat_session_tests"); + TEST(can_init); + TEST(adding_new_sets_state_to_active); +} diff --git a/tests/testsuite.c b/tests/testsuite.c index e7a23005..b4001ef1 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -7,6 +7,7 @@ int main(void) register_contact_list_tests(); register_common_tests(); register_prof_autocomplete_tests(); + register_chat_session_tests(); run_suite(); return 0; } diff --git a/tests/testsuite.h b/tests/testsuite.h index 45145c9b..cd836622 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -5,5 +5,6 @@ void register_prof_history_tests(void); void register_contact_list_tests(void); void register_common_tests(void); void register_prof_autocomplete_tests(void); +void register_chat_session_tests(void); #endif |