about summary refs log tree commit diff stats
path: root/tests/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-02 00:59:32 +0000
committerJames Booth <boothj5@gmail.com>2014-02-02 00:59:32 +0000
commit9d957e5f937e415875a310585e5e1e2a538d0499 (patch)
treee9ae1206b88a75cbade4cf8035d4396d3cec7bc3 /tests/xmpp
parent92b85bb7f121dd5ad852b9c0702e9fccc4ef6d18 (diff)
downloadprofani-tty-9d957e5f937e415875a310585e5e1e2a538d0499.tar.gz
Show message on /bookmark remove when bookmark does not exist
Diffstat (limited to 'tests/xmpp')
-rw-r--r--tests/xmpp/mock_xmpp.c8
-rw-r--r--tests/xmpp/mock_xmpp.h3
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/xmpp/mock_xmpp.c b/tests/xmpp/mock_xmpp.c
index b670959c..054e3fdd 100644
--- a/tests/xmpp/mock_xmpp.c
+++ b/tests/xmpp/mock_xmpp.c
@@ -73,11 +73,12 @@ _mock_bookmark_add(const char *jid, const char *nick, gboolean autojoin)
     return (gboolean)mock();
 }
 
-static void
+static gboolean
 _mock_bookmark_remove(const char *jid, gboolean autojoin)
 {
     check_expected(jid);
     check_expected(autojoin);
+    return (gboolean)mock();
 }
 
 void
@@ -210,8 +211,11 @@ expect_and_return_bookmark_add(char *expected_jid, char *expected_nick,
 }
 
 void
-expect_bookmark_remove(char *expected_jid, gboolean expected_autojoin)
+expect_and_return_bookmark_remove(char *expected_jid, gboolean expected_autojoin,
+    gboolean removed)
 {
     expect_string(_mock_bookmark_remove, jid, expected_jid);
     expect_value(_mock_bookmark_remove, autojoin, expected_autojoin);
+
+    will_return(_mock_bookmark_remove, removed);
 }
diff --git a/tests/xmpp/mock_xmpp.h b/tests/xmpp/mock_xmpp.h
index 6e00a824..82b4f8d0 100644
--- a/tests/xmpp/mock_xmpp.h
+++ b/tests/xmpp/mock_xmpp.h
@@ -28,6 +28,7 @@ void expect_and_return_bookmark_add(char *expected_jid, char *expected_nick,
     gboolean expected_autojoin, gboolean added);
 
 void mock_bookmark_remove(void);
-void expect_bookmark_remove(char *expected_jid, gboolean expected_autojoin);
+void expect_and_return_bookmark_remove(char *expected_jid, gboolean expected_autojoin,
+    gboolean removed);
 
 #endif