about summary refs log tree commit diff stats
path: root/tests/otr/mock_otr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/otr/mock_otr.c')
-rw-r--r--tests/otr/mock_otr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/otr/mock_otr.c b/tests/otr/mock_otr.c
index 2fb2eab0..a259c156 100644
--- a/tests/otr/mock_otr.c
+++ b/tests/otr/mock_otr.c
@@ -27,6 +27,13 @@ _mock_otr_get_my_fingerprint(void)
     return (char *)mock();
 }
 
+static char *
+_mock_otr_get_their_fingerprint(const char * const recipient)
+{
+    check_expected(recipient);
+    return (char *)mock();
+}
+
 void
 otr_keygen_expect(ProfAccount *account)
 {
@@ -47,3 +54,11 @@ otr_get_my_fingerprint_returns(char *fingerprint)
     otr_get_my_fingerprint = _mock_otr_get_my_fingerprint;
     will_return(_mock_otr_get_my_fingerprint, fingerprint);
 }
+
+void
+otr_get_their_fingerprint_expect_and_return(char *recipient, char *fingerprint)
+{
+    otr_get_their_fingerprint = _mock_otr_get_their_fingerprint;
+    expect_string(_mock_otr_get_their_fingerprint, recipient, recipient);
+    will_return(_mock_otr_get_their_fingerprint, fingerprint);
+}