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
f8e6e5b9
Commit
f8e6e5b9
authored
Feb 11, 2019
by
Jakub Adam
Committed by
Olivier Crête
Mar 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: enable "trickle-ice" mode
Call nice_agent_peer_candidate_gathering_done () where appropriate.
parent
cce48cfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
tests/test-new-trickle.c
tests/test-new-trickle.c
+12
-0
tests/test-trickle.c
tests/test-trickle.c
+6
-0
No files found.
tests/test-new-trickle.c
View file @
f8e6e5b9
...
@@ -493,6 +493,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
...
@@ -493,6 +493,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
lagent
,
global_ls_id
));
g_debug
(
"Setting local candidates of ragent as remote candidates of lagent"
);
g_debug
(
"Setting local candidates of ragent as remote candidates of lagent"
);
...
@@ -514,6 +515,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
...
@@ -514,6 +515,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
lagent_candidate_gathering_done
);
g_assert
(
lagent_candidate_gathering_done
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
ragent
,
global_rs_id
));
while
(
global_ragent_state
<
NICE_COMPONENT_STATE_CONNECTED
)
while
(
global_ragent_state
<
NICE_COMPONENT_STATE_CONNECTED
)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
...
@@ -548,6 +550,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
...
@@ -548,6 +550,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
lagent
,
global_ls_id
));
g_debug
(
"Setting local candidates of ragent as remote candidates of lagent"
);
g_debug
(
"Setting local candidates of ragent as remote candidates of lagent"
);
swap_candidates
(
ragent
,
global_rs_id
,
lagent
,
global_ls_id
,
FALSE
);
swap_candidates
(
ragent
,
global_rs_id
,
lagent
,
global_ls_id
,
FALSE
);
...
@@ -579,6 +582,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
...
@@ -579,6 +582,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
lagent_candidate_gathering_done
);
g_assert
(
lagent_candidate_gathering_done
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
ragent
,
global_rs_id
));
cleanup
(
lagent
,
ragent
);
cleanup
(
lagent
,
ragent
);
}
}
...
@@ -604,6 +608,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
...
@@ -604,6 +608,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
lagent
,
global_ls_id
));
add_bad_candidate
(
lagent
,
global_ls_id
,
cand
);
add_bad_candidate
(
lagent
,
global_ls_id
,
cand
);
...
@@ -612,6 +617,8 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
...
@@ -612,6 +617,8 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
ragent
,
global_rs_id
));
// connchecks will fail causing this mainloop to quit
// connchecks will fail causing this mainloop to quit
while
(
global_lagent_state
!=
NICE_COMPONENT_STATE_FAILED
)
while
(
global_lagent_state
!=
NICE_COMPONENT_STATE_FAILED
)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
...
@@ -659,6 +666,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
...
@@ -659,6 +666,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
while
(
!
ragent_candidate_gathering_done
)
while
(
!
ragent_candidate_gathering_done
)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
lagent
,
global_ls_id
));
// Wait for data
// Wait for data
while
(
!
data_received
)
while
(
!
data_received
)
...
@@ -677,6 +685,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
...
@@ -677,6 +685,7 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
!
lagent_candidate_gathering_done
)
!
lagent_candidate_gathering_done
)
g_main_context_iteration
(
NULL
,
TRUE
);
g_main_context_iteration
(
NULL
,
TRUE
);
g_cancellable_reset
(
global_cancellable
);
g_cancellable_reset
(
global_cancellable
);
g_assert
(
nice_agent_peer_candidate_gathering_done
(
ragent
,
global_rs_id
));
g_assert
(
lagent_candidate_gathering_done
);
g_assert
(
lagent_candidate_gathering_done
);
g_assert
(
ragent_candidate_gathering_done
);
g_assert
(
ragent_candidate_gathering_done
);
...
@@ -739,6 +748,9 @@ int main(void)
...
@@ -739,6 +748,9 @@ int main(void)
g_object_set
(
G_OBJECT
(
lagent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-trickle"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"ice-trickle"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"controlling-mode"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"controlling-mode"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"controlling-mode"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"controlling-mode"
,
FALSE
,
NULL
);
...
...
tests/test-trickle.c
View file @
f8e6e5b9
...
@@ -272,6 +272,9 @@ int main (void)
...
@@ -272,6 +272,9 @@ int main (void)
g_object_set
(
G_OBJECT
(
lagent
),
"controlling-mode"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"controlling-mode"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"controlling-mode"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"controlling-mode"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-trickle"
,
TRUE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"ice-trickle"
,
TRUE
,
NULL
);
/* An application using more than one NiceAgent instance may crash due to
/* An application using more than one NiceAgent instance may crash due to
* a race in gUPnP.
* a race in gUPnP.
*
*
...
@@ -336,6 +339,9 @@ int main (void)
...
@@ -336,6 +339,9 @@ int main (void)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_slist_free
(
cands
);
nice_agent_peer_candidate_gathering_done
(
lagent
,
ls_id
);
nice_agent_peer_candidate_gathering_done
(
ragent
,
rs_id
);
g_debug
(
"test-trickle: Set properties, next running mainloop until connectivity checks succeed..."
);
g_debug
(
"test-trickle: Set properties, next running mainloop until connectivity checks succeed..."
);
/* step: run the mainloop until connectivity checks succeed
/* step: run the mainloop until connectivity checks succeed
...
...
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