From d54cbf126aa520adf3ea43b28f5c39d96e12fbd6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 20 Jul 2015 22:18:50 +0100 Subject: [PATCH] Added receipt request functional test --- Makefile.am | 1 + tests/functionaltests/functionaltests.c | 5 ++++- tests/functionaltests/test_receipts.c | 29 +++++++++++++++++++++++++ tests/functionaltests/test_receipts.h | 2 ++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/functionaltests/test_receipts.c create mode 100644 tests/functionaltests/test_receipts.h diff --git a/Makefile.am b/Makefile.am index cd55662b..88254721 100644 --- a/Makefile.am +++ b/Makefile.am @@ -102,6 +102,7 @@ functionaltest_sources = \ tests/functionaltests/test_message.c tests/functionaltests/test_message.h \ tests/functionaltests/test_chat_session.c tests/functionaltests/test_chat_session.h \ tests/functionaltests/test_carbons.c tests/functionaltests/test_carbons.h \ + tests/functionaltests/test_receipts.c tests/functionaltests/test_receipts.h \ tests/functionaltests/functionaltests.c main_source = src/main.c diff --git a/tests/functionaltests/functionaltests.c b/tests/functionaltests/functionaltests.c index ecdfaa01..8650ea3a 100644 --- a/tests/functionaltests/functionaltests.c +++ b/tests/functionaltests/functionaltests.c @@ -17,6 +17,7 @@ #include "test_message.h" #include "test_carbons.h" #include "test_chat_session.h" +#include "test_receipts.h" #define PROF_FUNC_TEST(test) unit_test_setup_teardown(test, init_prof_test, close_prof_test) @@ -63,7 +64,9 @@ int main(int argc, char* argv[]) { PROF_FUNC_TEST(connect_with_carbons_enabled), PROF_FUNC_TEST(send_disable_carbons), PROF_FUNC_TEST(receive_carbon), - PROF_FUNC_TEST(receive_self_carbon) + PROF_FUNC_TEST(receive_self_carbon), + + PROF_FUNC_TEST(send_receipt_request), }; return run_tests(all_tests); diff --git a/tests/functionaltests/test_receipts.c b/tests/functionaltests/test_receipts.c new file mode 100644 index 00000000..0360fda8 --- /dev/null +++ b/tests/functionaltests/test_receipts.c @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "proftest.h" + +void +send_receipt_request(void **state) +{ + prof_input("/receipts request on"); + + prof_connect(); + + prof_input("/msg somejid@someserver.com Hi there"); + + assert_true(stbbr_received( + "" + "Hi there" + "" + "" + )); +} diff --git a/tests/functionaltests/test_receipts.h b/tests/functionaltests/test_receipts.h new file mode 100644 index 00000000..efd18f1e --- /dev/null +++ b/tests/functionaltests/test_receipts.h @@ -0,0 +1,2 @@ +void send_receipt_request(void **state); +