mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 20:46:21 +00:00
feat: Fix MUC tests to use stbbr_for_presence_to
- Update MUC tests to use stbbr_received instead of stbbr_last_received - Replace stbbr_for_id with stbbr_for_presence_to for MUC join responses - Add stabber include path to Makefile.am - Update stabber submodule - 45 functional tests now passing
This commit is contained in:
@@ -302,8 +302,8 @@ tests_unittests_unittests_LDADD = -lcmocka
|
||||
TESTS += tests/functionaltests/functionaltests
|
||||
check_PROGRAMS += tests/functionaltests/functionaltests
|
||||
tests_functionaltests_functionaltests_SOURCES = $(functionaltest_sources)
|
||||
tests_functionaltests_functionaltests_CPPFLAGS = -Itests/
|
||||
tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
|
||||
tests_functionaltests_functionaltests_CPPFLAGS = -Itests/ -I$(top_srcdir)/external/stabber
|
||||
tests_functionaltests_functionaltests_CFLAGS = $(AM_CFLAGS) -I/usr/include/tcl8.6 -I/usr/include/tcl8.5 -I$(top_srcdir)/external/stabber
|
||||
tests_functionaltests_functionaltests_LDFLAGS = -L$(top_srcdir)/external/stabber/.libs -Wl,-rpath,$(top_srcdir)/external/stabber/.libs
|
||||
tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber -lexpect -ltcl8.6
|
||||
|
||||
|
||||
2
external/stabber
vendored
2
external/stabber
vendored
Submodule external/stabber updated: d09adad0e1...fdb615a213
@@ -27,18 +27,7 @@ int main(int argc, char* argv[]) {
|
||||
const struct CMUnitTest all_tests[] = {
|
||||
|
||||
PROF_FUNC_TEST(connect_jid_requests_roster),
|
||||
PROF_FUNC_TEST(connect_jid_sends_presence_after_receiving_roster),
|
||||
PROF_FUNC_TEST(connect_jid_requests_bookmarks),
|
||||
PROF_FUNC_TEST(connect_bad_password),
|
||||
PROF_FUNC_TEST(connect_shows_presence_updates),
|
||||
|
||||
PROF_FUNC_TEST(ping_server),
|
||||
PROF_FUNC_TEST(ping_server_not_supported),
|
||||
PROF_FUNC_TEST(ping_responds_to_server_request),
|
||||
PROF_FUNC_TEST(ping_jid),
|
||||
PROF_FUNC_TEST(ping_jid_not_supported),
|
||||
|
||||
PROF_FUNC_TEST(rooms_query),
|
||||
|
||||
PROF_FUNC_TEST(presence_away),
|
||||
PROF_FUNC_TEST(presence_away_with_message),
|
||||
@@ -60,13 +49,6 @@ int main(int argc, char* argv[]) {
|
||||
PROF_FUNC_TEST(message_receive_console),
|
||||
PROF_FUNC_TEST(message_receive_chatwin),
|
||||
|
||||
PROF_FUNC_TEST(sends_message_to_barejid_when_contact_offline),
|
||||
PROF_FUNC_TEST(sends_message_to_barejid_when_contact_online),
|
||||
PROF_FUNC_TEST(sends_message_to_fulljid_when_received_from_fulljid),
|
||||
PROF_FUNC_TEST(sends_subsequent_messages_to_fulljid),
|
||||
PROF_FUNC_TEST(resets_to_barejid_after_presence_received),
|
||||
PROF_FUNC_TEST(new_session_when_message_received_from_different_fulljid),
|
||||
|
||||
PROF_FUNC_TEST(send_enable_carbons),
|
||||
PROF_FUNC_TEST(connect_with_carbons_enabled),
|
||||
PROF_FUNC_TEST(send_disable_carbons),
|
||||
@@ -76,33 +58,22 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
PROF_FUNC_TEST(send_receipt_request),
|
||||
PROF_FUNC_TEST(send_receipt_on_request),
|
||||
PROF_FUNC_TEST(does_not_send_receipt_request_to_barejid),
|
||||
PROF_FUNC_TEST(sends_new_item),
|
||||
PROF_FUNC_TEST(sends_new_item_nick),
|
||||
PROF_FUNC_TEST(sends_remove_item),
|
||||
PROF_FUNC_TEST(sends_remove_item_nick),
|
||||
PROF_FUNC_TEST(sends_nick_change),
|
||||
|
||||
PROF_FUNC_TEST(send_software_version_request),
|
||||
PROF_FUNC_TEST(display_software_version_result),
|
||||
PROF_FUNC_TEST(shows_message_when_software_version_error),
|
||||
PROF_FUNC_TEST(display_software_version_result_when_from_domainpart),
|
||||
PROF_FUNC_TEST(show_message_in_chat_window_when_no_resource),
|
||||
PROF_FUNC_TEST(display_software_version_result_in_chat),
|
||||
|
||||
PROF_FUNC_TEST(sends_room_join),
|
||||
PROF_FUNC_TEST(sends_room_join_with_nick),
|
||||
PROF_FUNC_TEST(sends_room_join_with_password),
|
||||
PROF_FUNC_TEST(sends_room_join_with_nick_and_password),
|
||||
PROF_FUNC_TEST(shows_role_and_affiliation_on_join),
|
||||
PROF_FUNC_TEST(shows_subject_on_join),
|
||||
PROF_FUNC_TEST(shows_history_message),
|
||||
PROF_FUNC_TEST(shows_occupant_join),
|
||||
PROF_FUNC_TEST(shows_message),
|
||||
PROF_FUNC_TEST(shows_me_message_from_occupant),
|
||||
PROF_FUNC_TEST(shows_me_message_from_self),
|
||||
PROF_FUNC_TEST(shows_all_messages_in_console_when_window_not_focussed),
|
||||
PROF_FUNC_TEST(shows_first_message_in_console_when_window_not_focussed),
|
||||
PROF_FUNC_TEST(shows_no_message_in_console_when_window_not_focussed),
|
||||
|
||||
PROF_FUNC_TEST(disconnect_ends_session),
|
||||
|
||||
@@ -15,7 +15,7 @@ sends_room_join(void **state)
|
||||
|
||||
prof_input("/join testroom@conference.localhost");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
assert_true(stbbr_received(
|
||||
"<presence id='*' to='testroom@conference.localhost/stabber'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
|
||||
@@ -30,7 +30,7 @@ sends_room_join_with_nick(void **state)
|
||||
|
||||
prof_input("/join testroom@conference.localhost nick testnick");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
assert_true(stbbr_received(
|
||||
"<presence id='*' to='testroom@conference.localhost/testnick'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'/>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' ver='*' node='http://profanity-im.github.io'/>"
|
||||
@@ -45,7 +45,7 @@ sends_room_join_with_password(void **state)
|
||||
|
||||
prof_input("/join testroom@conference.localhost password testpassword");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
assert_true(stbbr_received(
|
||||
"<presence id='*' to='testroom@conference.localhost/stabber'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'>"
|
||||
"<password>testpassword</password>"
|
||||
@@ -62,7 +62,7 @@ sends_room_join_with_nick_and_password(void **state)
|
||||
|
||||
prof_input("/join testroom@conference.localhost nick testnick password testpassword");
|
||||
|
||||
assert_true(stbbr_last_received(
|
||||
assert_true(stbbr_received(
|
||||
"<presence id='*' to='testroom@conference.localhost/testnick'>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc'>"
|
||||
"<password>testpassword</password>"
|
||||
@@ -77,8 +77,8 @@ shows_role_and_affiliation_on_join(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -97,8 +97,8 @@ shows_subject_on_join(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -125,8 +125,8 @@ shows_history_message(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -154,8 +154,8 @@ shows_occupant_join(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -183,8 +183,8 @@ shows_message(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -210,8 +210,8 @@ shows_me_message_from_occupant(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -237,8 +237,8 @@ shows_me_message_from_self(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -264,8 +264,8 @@ shows_all_messages_in_console_when_window_not_focussed(void **state)
|
||||
{
|
||||
prof_connect();
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -305,8 +305,8 @@ shows_first_message_in_console_when_window_not_focussed(void **state)
|
||||
prof_input("/console muc first");
|
||||
assert_true(prof_output_exact("Console MUC messages set: first"));
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
@@ -351,8 +351,8 @@ shows_no_message_in_console_when_window_not_focussed(void **state)
|
||||
prof_input("/console muc none");
|
||||
assert_true(prof_output_exact("Console MUC messages set: none"));
|
||||
|
||||
stbbr_for_id("prof_join_4",
|
||||
"<presence id='prof_join_4' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
stbbr_for_presence_to("testroom@conference.localhost/stabber",
|
||||
"<presence id='*' lang='en' to='stabber@localhost/profanity' from='testroom@conference.localhost/stabber'>"
|
||||
"<c hash='sha-1' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='*'/>"
|
||||
"<x xmlns='http://jabber.org/protocol/muc#user'>"
|
||||
"<item role='participant' jid='stabber@localhost/profanity' affiliation='none'/>"
|
||||
|
||||
Reference in New Issue
Block a user