mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-23 14:18:07 +00:00
add first_invite_generating conference tester
This commit is contained in:
parent
352aa5568c
commit
2c7994a27b
3 changed files with 45 additions and 11 deletions
|
|
@ -60,7 +60,7 @@ void RemoteConference::removeParticipant (const shared_ptr<const Participant> &p
|
|||
}
|
||||
|
||||
|
||||
string RemoteConference::getResourceLists (const list<const Address> &addresses) {
|
||||
string RemoteConference::getResourceLists (const list<Address> &addresses) {
|
||||
ResourceLists rl = ResourceLists();
|
||||
ListType l = ListType();
|
||||
for (const auto &addr : addresses) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public:
|
|||
std::shared_ptr<Participant> addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override;
|
||||
void removeParticipant (const std::shared_ptr<const Participant> &participant) override;
|
||||
|
||||
std::string getResourceLists (const std::list<const Address> &addresses);
|
||||
std::string getResourceLists (const std::list<Address> &addresses);
|
||||
|
||||
protected:
|
||||
/* ConferenceListener */
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
#include "linphone/core.h"
|
||||
#include "private.h"
|
||||
#include "liblinphone_tester.h"
|
||||
#include "conference/conference-listener.h"
|
||||
#include "conference/local-conference.h"
|
||||
#include "conference/remote-conference.h"
|
||||
|
||||
|
|
@ -46,15 +45,14 @@ static const string sarahAddr = "sip:sarah-bache@sip.linphone.org";
|
|||
static const string bobName = "Le Bricoleur";
|
||||
static const string sarahName = "Sarah";
|
||||
|
||||
void first_invite_parsing () {
|
||||
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
|
||||
Address marieIdentity(linphone_address_as_string_uri_only(marie->identity));
|
||||
LocalConference localConf(marie->lc, marieIdentity);
|
||||
list<Address> addresses = localConf.parseResourceLists(firstInvite);
|
||||
static void check_first_invite(LinphoneCore *core, const Address &address, string invite) {
|
||||
LocalConference localConf(core, address);
|
||||
list<Address> addresses = localConf.parseResourceLists(invite);
|
||||
BC_ASSERT_EQUAL(addresses.size(), 5, int, "%d");
|
||||
if (addresses.size() != 5)
|
||||
goto end;
|
||||
return;
|
||||
BC_ASSERT_TRUE(addresses.front().asStringUriOnly() == aliceAddr);
|
||||
BC_ASSERT_TRUE(addresses.front().getDisplayName().empty());
|
||||
addresses.pop_front();
|
||||
|
||||
BC_ASSERT_TRUE(addresses.front().asStringUriOnly() == bobAddr);
|
||||
|
|
@ -62,21 +60,57 @@ void first_invite_parsing () {
|
|||
addresses.pop_front();
|
||||
|
||||
BC_ASSERT_TRUE(addresses.front().asStringUriOnly() == johnAddr);
|
||||
BC_ASSERT_TRUE(addresses.front().getDisplayName().empty());
|
||||
addresses.pop_front();
|
||||
|
||||
BC_ASSERT_TRUE(addresses.front().asStringUriOnly() == anneAddr);
|
||||
BC_ASSERT_TRUE(addresses.front().getDisplayName().empty());
|
||||
addresses.pop_front();
|
||||
|
||||
BC_ASSERT_TRUE(addresses.front().asStringUriOnly() == sarahAddr);
|
||||
BC_ASSERT_TRUE(addresses.front().getDisplayName() == sarahName);
|
||||
addresses.pop_front();
|
||||
|
||||
}
|
||||
|
||||
void first_invite_parsing () {
|
||||
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
|
||||
const Address marieIdentity(linphone_address_as_string_uri_only(marie->identity));
|
||||
check_first_invite(marie->lc, marieIdentity, firstInvite);
|
||||
linphone_core_manager_destroy(marie);
|
||||
}
|
||||
|
||||
void first_invite_serializing() {
|
||||
LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc");
|
||||
const Address marieIdentity(linphone_address_as_string_uri_only(marie->identity));
|
||||
RemoteConference remoteConf(marie->lc, marieIdentity);
|
||||
list<Address> addresses = list<Address>();
|
||||
string xmlBody;
|
||||
|
||||
Address aliceIdentity(aliceAddr);
|
||||
Address bobIdentity(bobAddr);
|
||||
Address johnIdentity(johnAddr);
|
||||
Address anneIdentity(anneAddr);
|
||||
Address sarahIdentity(sarahAddr);
|
||||
|
||||
bobIdentity.setDisplayName(bobName);
|
||||
sarahIdentity.setDisplayName(sarahName);
|
||||
|
||||
addresses.push_back(aliceIdentity);
|
||||
addresses.push_back(bobIdentity);
|
||||
addresses.push_back(johnIdentity);
|
||||
addresses.push_back(anneIdentity);
|
||||
addresses.push_back(sarahIdentity);
|
||||
|
||||
xmlBody = remoteConf.getResourceLists(addresses);
|
||||
check_first_invite(marie->lc, marieIdentity, xmlBody);
|
||||
|
||||
end:
|
||||
linphone_core_manager_destroy(marie);
|
||||
}
|
||||
|
||||
test_t conference_tests[] = {
|
||||
TEST_NO_TAG("First invite parsing", first_invite_parsing)
|
||||
TEST_NO_TAG("First invite parsing", first_invite_parsing),
|
||||
TEST_NO_TAG("First invite serializing", first_invite_serializing)
|
||||
};
|
||||
|
||||
test_suite_t conference_test_suite = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue