about summary refs log tree commit diff stats
path: root/tests/otr
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-12-24 23:32:32 +0000
committerJames Booth <boothj5@gmail.com>2014-12-24 23:32:32 +0000
commit419f37feea3c22e9e6c51bb035a717ab7d29e2fd (patch)
treec8f485d5b0e1d20908cf3399d223e0011847f601 /tests/otr
parentaa4ffa7e8c9fa0f1b045b1b1c9fe478be552fd82 (diff)
downloadprofani-tty-419f37feea3c22e9e6c51bb035a717ab7d29e2fd.tar.gz
Added cmd_otr tests
Diffstat (limited to 'tests/otr')
-rw-r--r--tests/otr/stub_otr.c101
1 files changed, 101 insertions, 0 deletions
diff --git a/tests/otr/stub_otr.c b/tests/otr/stub_otr.c
index e69de29b..82994034 100644
--- a/tests/otr/stub_otr.c
+++ b/tests/otr/stub_otr.c
@@ -0,0 +1,101 @@
+#include <libotr/proto.h>
+#include <libotr/message.h>
+#include <glib.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <cmocka.h>
+
+#include "config/account.h"
+
+#include "otr/otr.h"
+
+OtrlUserState otr_userstate(void)
+{
+    return NULL;
+}
+
+OtrlMessageAppOps* otr_messageops(void)
+{
+    return NULL;
+}
+
+GHashTable* otr_smpinitators(void)
+{
+    return NULL;
+}
+
+void otr_init(void) {}
+void otr_shutdown(void) {}
+
+char* otr_libotr_version(void)
+{
+    return (char*)mock();
+}
+
+char* otr_start_query(void)
+{
+    return (char*)mock();
+}
+
+void otr_poll(void) {}
+void otr_on_connect(ProfAccount *account) {}
+
+void otr_keygen(ProfAccount *account)
+{
+    check_expected(account);
+}
+
+gboolean otr_key_loaded(void)
+{
+    return (gboolean)mock();
+}
+
+gboolean otr_is_secure(const char * const recipient)
+{
+    return FALSE;
+}
+
+gboolean otr_is_trusted(const char * const recipient)
+{
+    return FALSE;
+}
+
+void otr_trust(const char * const recipient) {}
+void otr_untrust(const char * const recipient) {}
+
+void otr_smp_secret(const char * const recipient, const char *secret) {}
+void otr_smp_question(const char * const recipient, const char *question, const char *answer) {}
+void otr_smp_answer(const char * const recipient, const char *answer) {}
+
+void otr_end_session(const char * const recipient) {}
+
+char * otr_get_my_fingerprint(void)
+{
+    return (char *)mock();
+}
+
+char * otr_get_their_fingerprint(const char * const recipient)
+{
+    check_expected(recipient);
+    return (char *)mock();
+}
+
+char * otr_encrypt_message(const char * const to, const char * const message)
+{
+    return NULL;
+}
+
+char * otr_decrypt_message(const char * const from, const char * const message,
+    gboolean *was_decrypted)
+{
+    return NULL;
+}
+
+void otr_free_message(char *message) {}
+
+prof_otrpolicy_t otr_get_policy(const char * const recipient)
+{
+    return PROF_OTRPOLICY_MANUAL;
+}
\ No newline at end of file