diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-07-07 14:18:57 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-07-07 14:18:57 +0200 |
commit | a2726b6a7d16f5f846a882fbbe9127e4604bb8bb (patch) | |
tree | e6d101676dec96430eafa645ad2b7bd5391a4294 /tests/unittests/test_server_events.c | |
parent | 95015cec56fa56f2ef97227edf06de17c65000d9 (diff) | |
download | profani-tty-a2726b6a7d16f5f846a882fbbe9127e4604bb8bb.tar.gz |
Apply coding style
Diffstat (limited to 'tests/unittests/test_server_events.c')
-rw-r--r-- | tests/unittests/test_server_events.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/tests/unittests/test_server_events.c b/tests/unittests/test_server_events.c index 54688dec..4ecedace 100644 --- a/tests/unittests/test_server_events.c +++ b/tests/unittests/test_server_events.c @@ -17,15 +17,16 @@ #include "plugins/plugins.h" #include "ui/window_list.h" -void console_shows_online_presence_when_set_online(void **state) +void +console_shows_online_presence_when_set_online(void** state) { prefs_set_string(PREF_STATUSES_CONSOLE, "online"); plugins_init(); roster_create(); roster_process_pending_presence(); - char *barejid = "test1@server"; + char* barejid = "test1@server"; roster_add(barejid, "bob", NULL, "both", FALSE); - Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); + Resource* resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid)); expect_memory(ui_contact_online, resource, resource, sizeof(resource)); @@ -37,15 +38,16 @@ void console_shows_online_presence_when_set_online(void **state) plugins_shutdown(); } -void console_shows_online_presence_when_set_all(void **state) +void +console_shows_online_presence_when_set_all(void** state) { prefs_set_string(PREF_STATUSES_CONSOLE, "all"); plugins_init(); roster_create(); roster_process_pending_presence(); - char *barejid = "test1@server"; + char* barejid = "test1@server"; roster_add(barejid, "bob", NULL, "both", FALSE); - Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); + Resource* resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid)); expect_memory(ui_contact_online, resource, resource, sizeof(resource)); @@ -57,15 +59,16 @@ void console_shows_online_presence_when_set_all(void **state) plugins_shutdown(); } -void console_shows_dnd_presence_when_set_all(void **state) +void +console_shows_dnd_presence_when_set_all(void** state) { prefs_set_string(PREF_STATUSES_CONSOLE, "all"); plugins_init(); roster_create(); roster_process_pending_presence(); - char *barejid = "test1@server"; + char* barejid = "test1@server"; roster_add(barejid, "bob", NULL, "both", FALSE); - Resource *resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); + Resource* resource = resource_new("resource", RESOURCE_ONLINE, NULL, 10); expect_memory(ui_contact_online, barejid, barejid, sizeof(barejid)); expect_memory(ui_contact_online, resource, resource, sizeof(resource)); @@ -77,23 +80,24 @@ void console_shows_dnd_presence_when_set_all(void **state) plugins_shutdown(); } -void handle_offline_removes_chat_session(void **state) +void +handle_offline_removes_chat_session(void** state) { plugins_init(); roster_create(); roster_process_pending_presence(); chat_sessions_init(); - char *barejid = "friend@server.chat.com"; - char *resource = "home"; + char* barejid = "friend@server.chat.com"; + char* resource = "home"; roster_add(barejid, "bob", NULL, "both", FALSE); - Resource *resourcep = resource_new(resource, RESOURCE_ONLINE, NULL, 10); + Resource* resourcep = resource_new(resource, RESOURCE_ONLINE, NULL, 10); roster_update_presence(barejid, resourcep, NULL); chat_session_recipient_active(barejid, resource, FALSE); - ProfConsoleWin *console = malloc(sizeof(ProfConsoleWin)); + ProfConsoleWin* console = malloc(sizeof(ProfConsoleWin)); will_return(win_create_console, &console->window); wins_init(); sv_ev_contact_offline(barejid, resource, NULL); - ChatSession *session = chat_session_get(barejid); + ChatSession* session = chat_session_get(barejid); assert_null(session); @@ -102,7 +106,8 @@ void handle_offline_removes_chat_session(void **state) plugins_shutdown(); } -void lost_connection_clears_chat_sessions(void **state) +void +lost_connection_clears_chat_sessions(void** state) { roster_create(); roster_process_pending_presence(); @@ -113,8 +118,8 @@ void lost_connection_clears_chat_sessions(void **state) sv_ev_lost_connection(); - ChatSession *session1 = chat_session_get("bob@server.org"); - ChatSession *session2 = chat_session_get("steve@server.org"); + ChatSession* session1 = chat_session_get("bob@server.org"); + ChatSession* session2 = chat_session_get("steve@server.org"); assert_null(session1); assert_null(session2); } |