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:33:12 +0100
committerJames Booth <boothj5@gmail.com>2014-04-01 23:33:12 +0100
commit7113b979524d16a20048e2533cffa580a0b2d288 (patch)
treee87475708def4c3f548f2bff357faae0ffd8077d /tests/ui
parent96e32fe17846a8ef25faad25bd57fbdc7338a16f (diff)
downloadprofani-tty-7113b979524d16a20048e2533cffa580a0b2d288.tar.gz
Added test for valid window switch
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/mock_ui.c14
-rw-r--r--tests/ui/mock_ui.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c
index 5dc52a10..03960e58 100644
--- a/tests/ui/mock_ui.c
+++ b/tests/ui/mock_ui.c
@@ -184,13 +184,18 @@ gboolean _mock_ui_win_exists(int index)
     return (gboolean)mock();
 }
 
+static
+void _mock_ui_switch_win(const int i)
+{
+    check_expected(i);
+}
+
 // bind mocks and stubs
 
 void
 mock_cons_show(void)
 {
     cons_show = _mock_cons_show;
-
 }
 
 void
@@ -458,3 +463,10 @@ 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 = _mock_ui_switch_win;
+    expect_value(_mock_ui_switch_win, i, given_i);
+}
diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h
index c939a002..197436b3 100644
--- a/tests/ui/mock_ui.h
+++ b/tests/ui/mock_ui.h
@@ -67,4 +67,6 @@ 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);
+
 #endif