Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
2c7994a2
Commit
2c7994a2
authored
Sep 25, 2017
by
Benjamin REIS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add first_invite_generating conference tester
parent
352aa556
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
11 deletions
+45
-11
src/conference/remote-conference.cpp
src/conference/remote-conference.cpp
+1
-1
src/conference/remote-conference.h
src/conference/remote-conference.h
+1
-1
tester/conference-tester.cpp
tester/conference-tester.cpp
+43
-9
No files found.
src/conference/remote-conference.cpp
View file @
2c7994a2
...
...
@@ -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
)
{
...
...
src/conference/remote-conference.h
View file @
2c7994a2
...
...
@@ -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 */
...
...
tester/conference-tester.cpp
View file @
2c7994a2
...
...
@@ -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
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment