Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
bd11e72d
Commit
bd11e72d
authored
Jan 20, 2011
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some testing for the nice_agent_set_port_range API
parent
8d148c97
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
2 deletions
+55
-2
tests/test-fullmode.c
tests/test-fullmode.c
+55
-2
No files found.
tests/test-fullmode.c
View file @
bd11e72d
...
@@ -353,8 +353,61 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
...
@@ -353,8 +353,61 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
#endif
#endif
nice_agent_gather_candidates
(
lagent
,
ls_id
);
/* Gather candidates and test nice_agent_set_port_range */
nice_agent_gather_candidates
(
ragent
,
rs_id
);
nice_agent_set_port_range
(
lagent
,
ls_id
,
1
,
10000
,
10000
);
nice_agent_set_port_range
(
lagent
,
ls_id
,
2
,
10001
,
10001
);
nice_agent_set_port_range
(
ragent
,
rs_id
,
1
,
12345
,
12345
);
nice_agent_set_port_range
(
ragent
,
rs_id
,
2
,
10000
,
10001
);
g_assert
(
nice_agent_gather_candidates
(
lagent
,
ls_id
)
==
TRUE
);
g_assert
(
nice_agent_gather_candidates
(
ragent
,
rs_id
)
==
FALSE
);
g_assert
(
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
1
)
==
NULL
);
g_assert
(
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
2
)
==
NULL
);
nice_agent_set_port_range
(
ragent
,
rs_id
,
2
,
10000
,
10002
);
g_assert
(
nice_agent_gather_candidates
(
ragent
,
rs_id
)
==
TRUE
);
#ifdef USE_LOOPBACK
{
GSList
*
cands
=
NULL
,
*
i
;
NiceCandidate
*
cand
=
NULL
;
cands
=
nice_agent_get_local_candidates
(
lagent
,
ls_id
,
1
);
g_assert
(
g_slist_length
(
cands
)
==
1
);
cand
=
cands
->
data
;
g_assert
(
cand
->
type
==
NICE_CANDIDATE_TYPE_HOST
);
g_assert
(
nice_address_get_port
(
&
cand
->
addr
)
==
10000
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
cands
=
nice_agent_get_local_candidates
(
lagent
,
ls_id
,
2
);
g_assert
(
g_slist_length
(
cands
)
==
1
);
cand
=
cands
->
data
;
g_assert
(
cand
->
type
==
NICE_CANDIDATE_TYPE_HOST
);
g_assert
(
nice_address_get_port
(
&
cand
->
addr
)
==
10001
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
cands
=
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
1
);
g_assert
(
g_slist_length
(
cands
)
==
1
);
cand
=
cands
->
data
;
g_assert
(
cand
->
type
==
NICE_CANDIDATE_TYPE_HOST
);
g_assert
(
nice_address_get_port
(
&
cand
->
addr
)
==
12345
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
cands
=
nice_agent_get_local_candidates
(
ragent
,
rs_id
,
2
);
g_assert
(
g_slist_length
(
cands
)
==
1
);
cand
=
cands
->
data
;
g_assert
(
cand
->
type
==
NICE_CANDIDATE_TYPE_HOST
);
g_assert
(
nice_address_get_port
(
&
cand
->
addr
)
==
10002
);
for
(
i
=
cands
;
i
;
i
=
i
->
next
)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
}
#endif
/* step: attach to mainloop (needed to register the fds) */
/* step: attach to mainloop (needed to register the fds) */
nice_agent_attach_recv
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTP
,
nice_agent_attach_recv
(
lagent
,
ls_id
,
NICE_COMPONENT_TYPE_RTP
,
...
...
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