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:14:33 +0000
committerJames Booth <boothj5@gmail.com>2014-02-17 22:14:33 +0000
commit4afec6ab5e6385e15e605130e5f275aa759fab9a (patch)
tree895a80672418c4507cca95da95f0fb0c868c5633 /tests/ui
parent82ad0cd306968ae6821127829e9d52f01932e82e (diff)
downloadprofani-tty-4afec6ab5e6385e15e605130e5f275aa759fab9a.tar.gz
Added test for /otr theirfp when in console
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/mock_ui.c22
-rw-r--r--tests/ui/mock_ui.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c
index af9d1a6b..d2f6944e 100644
--- a/tests/ui/mock_ui.c
+++ b/tests/ui/mock_ui.c
@@ -171,6 +171,16 @@ void _mock_ui_current_print_formatted_line(const char show_char, int attrs, cons
     va_end(args);
 }
 
+static
+void _mock_ui_current_print_line(const char * const msg, ...)
+{
+    va_list args;
+    va_start(args, msg);
+    vsnprintf(output, sizeof(output), msg, args);
+    check_expected(output);
+    va_end(args);
+}
+
 // bind mocks and stubs
 
 void
@@ -270,6 +280,12 @@ mock_ui_current_print_formatted_line(void)
     ui_current_print_formatted_line = _mock_ui_current_print_formatted_line;
 }
 
+void
+mock_ui_current_print_line(void)
+{
+    ui_current_print_line = _mock_ui_current_print_line;
+}
+
 // expectations
 
 void
@@ -394,3 +410,9 @@ ui_current_print_formatted_line_expect(char show_char, int attrs, char *message)
     expect_value(_mock_ui_current_print_formatted_line, attrs, attrs);
     expect_string(_mock_ui_current_print_formatted_line, output, message);
 }
+
+void
+ui_current_print_line_expect(char *message)
+{
+    expect_string(_mock_ui_current_print_line, output, message);
+}
diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h
index 9cdd6b34..e7db7247 100644
--- a/tests/ui/mock_ui.h
+++ b/tests/ui/mock_ui.h
@@ -54,4 +54,7 @@ void stub_ui_current_refresh(void);
 void mock_ui_current_print_formatted_line(void);
 void ui_current_print_formatted_line_expect(char show_char, int attrs, char *message);
 
+void mock_ui_current_print_line(void);
+void ui_current_print_line_expect(char *message);
+
 #endif