about summary refs log tree commit diff stats
path: root/tests/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-04-01 23:54:26 +0100
committerJames Booth <boothj5@gmail.com>2014-04-01 23:54:26 +0100
commitb19b881b97dccff4e5589b5585db27beea1683de (patch)
tree905823dd214fb3e5adcf6c5f8f7c5463378246e5 /tests/ui
parent7113b979524d16a20048e2533cffa580a0b2d288 (diff)
downloadprofani-tty-b19b881b97dccff4e5589b5585db27beea1683de.tar.gz
Added missing files, refactored ui_switch_win to check win exists
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/mock_ui.c26
-rw-r--r--tests/ui/mock_ui.h5
2 files changed, 5 insertions, 26 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c
index 03960e58..94f8e3c3 100644
--- a/tests/ui/mock_ui.c
+++ b/tests/ui/mock_ui.c
@@ -178,16 +178,10 @@ void _mock_cons_show_roster(GSList *list)
 }
 
 static
-gboolean _mock_ui_win_exists(int index)
-{
-    check_expected(index);
-    return (gboolean)mock();
-}
-
-static
-void _mock_ui_switch_win(const int i)
+gboolean _mock_ui_switch_win(const int i)
 {
     check_expected(i);
+    return (gboolean)mock();
 }
 
 // bind mocks and stubs
@@ -300,12 +294,6 @@ mock_cons_show_roster(void)
     cons_show_roster = _mock_cons_show_roster;
 }
 
-void
-mock_ui_win_exists(void)
-{
-    ui_win_exists = _mock_ui_win_exists;
-}
-
 // expectations
 
 void
@@ -458,15 +446,9 @@ cons_show_roster_expect(GSList *list)
 }
 
 void
-ui_win_exists_expect_and_return(int given_index, gboolean result)
-{
-    expect_value(_mock_ui_win_exists, index, given_index);
-    will_return(_mock_ui_win_exists, result);
-}
-
-void
-ui_switch_win_expect(int given_i)
+ui_switch_win_expect_and_return(int given_i, gboolean result)
 {
     ui_switch_win = _mock_ui_switch_win;
     expect_value(_mock_ui_switch_win, i, given_i);
+    will_return(_mock_ui_switch_win, result);
 }
diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h
index 197436b3..5b984615 100644
--- a/tests/ui/mock_ui.h
+++ b/tests/ui/mock_ui.h
@@ -64,9 +64,6 @@ void ui_room_join_expect(char *room);
 void mock_cons_show_roster(void);
 void cons_show_roster_expect(GSList *list);
 
-void mock_ui_win_exists(void);
-void ui_win_exists_expect_and_return(int given_index, gboolean result);
-
-void ui_switch_win_expect(int given_i);
+void ui_switch_win_expect_and_return(int given_i, gboolean result);
 
 #endif