about summary refs log tree commit diff stats
path: root/tests/otr
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-17 23:10:00 +0000
committerJames Booth <boothj5@gmail.com>2014-02-17 23:10:00 +0000
commit037ca818214dad46745576bf9af740f032ca0fc7 (patch)
tree58f0fd1dd3df417dd142680a03b97235b97d466a /tests/otr
parentb4b463998bec925c9f04def3ce48bbd475fd8aae (diff)
downloadprofani-tty-037ca818214dad46745576bf9af740f032ca0fc7.tar.gz
Test /otr theirfp
Diffstat (limited to 'tests/otr')
-rw-r--r--tests/otr/mock_otr.c15
-rw-r--r--tests/otr/mock_otr.h1
2 files changed, 16 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);
+}
diff --git a/tests/otr/mock_otr.h b/tests/otr/mock_otr.h
index e3908a64..3296c145 100644
--- a/tests/otr/mock_otr.h
+++ b/tests/otr/mock_otr.h
@@ -8,5 +8,6 @@ void otr_keygen_expect(ProfAccount *account);
 void otr_libotr_version_returns(char *version);
 
 void otr_get_my_fingerprint_returns(char *fingerprint);
+void otr_get_their_fingerprint_expect_and_return(char *recipient, char *fingerprint);
 
 #endif