about summary refs log tree commit diff stats
path: root/tests/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-17 22:57:36 +0000
committerJames Booth <boothj5@gmail.com>2014-02-17 22:57:36 +0000
commitb4b463998bec925c9f04def3ce48bbd475fd8aae (patch)
treece7759a29f44bc50dd2b84c7aff701a6c6c0c727 /tests/ui
parenta25714b6dcab354e5802344755b57e893361e4d6 (diff)
downloadprofani-tty-b4b463998bec925c9f04def3ce48bbd475fd8aae.tar.gz
Test for /otr theirfp in non OTR window
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/mock_ui.c13
-rw-r--r--tests/ui/mock_ui.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c
index d2f6944e..a79f0521 100644
--- a/tests/ui/mock_ui.c
+++ b/tests/ui/mock_ui.c
@@ -181,6 +181,12 @@ void _mock_ui_current_print_line(const char * const msg, ...)
     va_end(args);
 }
 
+static
+gboolean _mock_ui_current_win_is_otr(void)
+{
+    return (gboolean)mock();
+}
+
 // bind mocks and stubs
 
 void
@@ -416,3 +422,10 @@ ui_current_print_line_expect(char *message)
 {
     expect_string(_mock_ui_current_print_line, output, message);
 }
+
+void
+ui_current_win_is_otr_returns(gboolean result)
+{
+    ui_current_win_is_otr = _mock_ui_current_win_is_otr;
+    will_return(_mock_ui_current_win_is_otr, result);
+}
diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h
index e7db7247..a814f06e 100644
--- a/tests/ui/mock_ui.h
+++ b/tests/ui/mock_ui.h
@@ -57,4 +57,6 @@ void ui_current_print_formatted_line_expect(char show_char, int attrs, char *mes
 void mock_ui_current_print_line(void);
 void ui_current_print_line_expect(char *message);
 
+void ui_current_win_is_otr_returns(gboolean result);
+
 #endif