mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Added carbons command functional test
This commit is contained in:
parent
252c7c2e06
commit
5e324e407f
@ -101,6 +101,7 @@ functionaltest_sources = \
|
||||
tests/functionaltests/test_presence.c tests/functionaltests/test_presence.h \
|
||||
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/functionaltests.c
|
||||
|
||||
main_source = src/main.c
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "test_rooms.h"
|
||||
#include "test_presence.h"
|
||||
#include "test_message.h"
|
||||
#include "test_carbons.h"
|
||||
#include "test_chat_session.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
@ -113,6 +114,10 @@ int main(int argc, char* argv[]) {
|
||||
unit_test_setup_teardown(new_session_when_message_received_from_different_fulljid,
|
||||
init_prof_test,
|
||||
close_prof_test),
|
||||
|
||||
unit_test_setup_teardown(send_enable_carbons,
|
||||
init_prof_test,
|
||||
close_prof_test),
|
||||
};
|
||||
|
||||
return run_tests(all_tests);
|
||||
|
24
tests/functionaltests/test_carbons.c
Normal file
24
tests/functionaltests/test_carbons.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <glib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <setjmp.h>
|
||||
#include <cmocka.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stabber.h>
|
||||
#include <expect.h>
|
||||
|
||||
#include "proftest.h"
|
||||
|
||||
void
|
||||
send_enable_carbons(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
prof_input("/carbons on");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq id=\"*\" type=\"set\"><enable xmlns=\"urn:xmpp:carbons:2\"/></iq>"
|
||||
));
|
||||
}
|
1
tests/functionaltests/test_carbons.h
Normal file
1
tests/functionaltests/test_carbons.h
Normal file
@ -0,0 +1 @@
|
||||
void send_enable_carbons(void **state);
|
Loading…
Reference in New Issue
Block a user