Skip to content

Commit

Permalink
tests: RosterManager: Fix wrong server to/from address
Browse files Browse the repository at this point in the history
  • Loading branch information
lnjX committed Apr 7, 2023
1 parent bf1fc75 commit 8942999
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/qxmpprostermanager/tst_qxmpprostermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ void tst_QXmppRosterManager::testAddItem()
auto *rosterManager = test.addNewExtension<QXmppRosterManager>(&test);

auto future = rosterManager->addRosterItem("[email protected]");
test.expect("<iq id='qxmpp1' to='capulet.lit' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]'/></query></iq>");
test.inject<QString>("<iq id='qxmpp1' from='capulet.lit' type='result'/>");
test.expect("<iq id='qxmpp1' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]'/></query></iq>");
test.inject<QString>("<iq id='qxmpp1' type='result'/>");
expectFutureVariant<QXmpp::Success>(future);

future = rosterManager->addRosterItem("[email protected]");
test.expect("<iq id='qxmpp1' to='capulet.lit' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]'/></query></iq>");
test.expect("<iq id='qxmpp1' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]'/></query></iq>");
test.inject<QString>(R"(
<iq id='qxmpp1' from='capulet.lit' type='error'>
<iq id='qxmpp1' type='error'>
<error type='modify'>
<not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>This is not allowed</text>
Expand All @@ -143,14 +143,14 @@ void tst_QXmppRosterManager::testRemoveItem()
auto *rosterManager = test.addNewExtension<QXmppRosterManager>(&test);

auto future = rosterManager->removeRosterItem("[email protected]");
test.expect("<iq id='qxmpp1' to='capulet.lit' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]' subscription='remove'/></query></iq>");
test.inject<QString>("<iq id='qxmpp1' from='capulet.lit' type='result'/>");
test.expect("<iq id='qxmpp1' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]' subscription='remove'/></query></iq>");
test.inject<QString>("<iq id='qxmpp1' type='result'/>");
expectFutureVariant<QXmpp::Success>(future);

future = rosterManager->removeRosterItem("[email protected]");
test.expect("<iq id='qxmpp1' to='capulet.lit' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]' subscription='remove'/></query></iq>");
test.expect("<iq id='qxmpp1' type='set'><query xmlns='jabber:iq:roster'><item jid='[email protected]' subscription='remove'/></query></iq>");
test.inject<QString>(R"(
<iq id='qxmpp1' from='capulet.lit' type='error'>
<iq id='qxmpp1' type='error'>
<error type='cancel'>
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Not found</text>
Expand Down

0 comments on commit 8942999

Please sign in to comment.