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
4c80e203
Commit
4c80e203
authored
Apr 03, 2017
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
candidate: Test against possible type
There was a confusion and it tested against a value not in the enum.
parent
d71a6330
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
agent/candidate.c
agent/candidate.c
+3
-3
tests/test-priority.c
tests/test-priority.c
+2
-2
No files found.
agent/candidate.c
View file @
4c80e203
...
...
@@ -191,21 +191,21 @@ nice_candidate_ice_local_preference (const NiceCandidate *candidate)
{
case
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
:
if
(
candidate
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
||
candidate
->
type
==
NICE_CANDIDATE_TYPE_
PREF_NAT_ASSISTED
)
candidate
->
type
==
NICE_CANDIDATE_TYPE_
HOST
)
direction_preference
=
4
;
else
direction_preference
=
6
;
break
;
case
NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE
:
if
(
candidate
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
||
candidate
->
type
==
NICE_CANDIDATE_TYPE_
PREF_NAT_ASSISTED
)
candidate
->
type
==
NICE_CANDIDATE_TYPE_
HOST
)
direction_preference
=
2
;
else
direction_preference
=
4
;
break
;
case
NICE_CANDIDATE_TRANSPORT_TCP_SO
:
if
(
candidate
->
type
==
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
||
candidate
->
type
==
NICE_CANDIDATE_TYPE_
PREF_NAT_ASSISTED
)
candidate
->
type
==
NICE_CANDIDATE_TYPE_
HOST
)
direction_preference
=
6
;
else
direction_preference
=
2
;
...
...
tests/test-priority.c
View file @
4c80e203
...
...
@@ -61,11 +61,11 @@ main (void)
g_assert_cmpuint
(
nice_candidate_ice_priority
(
candidate
,
TRUE
,
FALSE
),
==
,
0x3C0001FF
);
/* Host tcp-active unreliable */
candidate
->
transport
=
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
;
g_assert_cmpuint
(
nice_candidate_ice_priority
(
candidate
,
FALSE
,
FALSE
)
&
0xFFE000FF
,
==
,
0x3C
C
000FF
);
g_assert_cmpuint
(
nice_candidate_ice_priority
(
candidate
,
FALSE
,
FALSE
)
&
0xFFE000FF
,
==
,
0x3C
8
000FF
);
/* Host tcp-active reliable */
candidate
->
transport
=
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
;
/* Host tcp-active reliable */
g_assert_cmpuint
(
nice_candidate_ice_priority
(
candidate
,
TRUE
,
FALSE
)
&
0xFFE000FF
,
==
,
0x78
C
000FF
);
g_assert_cmpuint
(
nice_candidate_ice_priority
(
candidate
,
TRUE
,
FALSE
)
&
0xFFE000FF
,
==
,
0x78
8
000FF
);
/* srv-reflexive tcp-active reliable */
candidate
->
type
=
NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE
;
candidate
->
transport
=
NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE
;
...
...
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