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
9afd0c8b
Commit
9afd0c8b
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: rename test-dribble to test-trickle
parent
a6112cec
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
35 deletions
+35
-35
agent/conncheck.c
agent/conncheck.c
+1
-1
tests/Makefile.am
tests/Makefile.am
+4
-4
tests/meson.build
tests/meson.build
+2
-2
tests/test-new-trickle.c
tests/test-new-trickle.c
+11
-11
tests/test-trickle.c
tests/test-trickle.c
+17
-17
No files found.
agent/conncheck.c
View file @
9afd0c8b
...
...
@@ -2785,7 +2785,7 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *str
nice_debug
(
"Agent %p : nothing to do for pair %p."
,
agent
,
p
);
/* note: this is a bit unsure corner-case -- let's do the
same state update as for processing responses to our own checks */
/* note: this update is required by the
dribb
le test, to
/* note: this update is required by the
trick
le test, to
* ensure the transition ready -> connected -> ready, because
* an incoming stun request generates a discovered peer reflexive,
* that causes the ready -> connected transition.
...
...
tests/Makefile.am
View file @
9afd0c8b
...
...
@@ -51,8 +51,8 @@ check_PROGRAMS = \
test-restart
\
test-fallback
\
test-thread
\
test-
dribb
le
\
test-new-
dribb
le
\
test-
trick
le
\
test-new-
trick
le
\
test-tcp
\
test-icetcp
\
test-credentials
\
...
...
@@ -122,9 +122,9 @@ test_restart_LDADD = $(COMMON_LDADD)
test_fallback_LDADD
=
$(COMMON_LDADD)
test_
dribb
le_LDADD
=
$(COMMON_LDADD)
test_
trick
le_LDADD
=
$(COMMON_LDADD)
test_new_
dribb
le_LDADD
=
$(COMMON_LDADD)
test_new_
trick
le_LDADD
=
$(COMMON_LDADD)
test_tcp_LDADD
=
$(COMMON_LDADD)
...
...
tests/meson.build
View file @
9afd0c8b
...
...
@@ -20,7 +20,7 @@ nice_tests = [
'test-restart',
'test-fallback',
'test-thread',
'test-
dribb
le',
'test-
trick
le',
'test-tcp',
'test-icetcp',
'test-credentials',
...
...
@@ -32,7 +32,7 @@ nice_tests = [
if cc.has_header('arpa/inet.h')
nice_tests += [
'test-pseudotcp-fin',
'test-new-
dribb
le',
'test-new-
trick
le',
]
endif
...
...
tests/test-new-
dribb
le.c
→
tests/test-new-
trick
le.c
View file @
9afd0c8b
/*
* This file is part of the Nice GLib ICE library.
*
* Unit test for ICE in
dribb
le mode (adding remote candidates while gathering
* Unit test for ICE in
trick
le mode (adding remote candidates while gathering
* local candidates).
*
* (C) 2012 Collabora Ltd.
...
...
@@ -283,7 +283,7 @@ static void swap_credentials (NiceAgent *lagent, guint lstream,
static
void
cb_candidate_gathering_done
(
NiceAgent
*
agent
,
guint
stream_id
,
gpointer
data
)
{
g_debug
(
"test-
dribb
lemode:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
lemode:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
{
g_debug
(
"lagent finished gathering candidates"
);
...
...
@@ -299,14 +299,14 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
{
gint
ret
;
g_debug
(
"test-
dribb
lemode:%s: %p"
,
G_STRFUNC
,
user_data
);
g_debug
(
"test-
trick
lemode:%s: %p"
,
G_STRFUNC
,
user_data
);
ret
=
strncmp
(
"0000"
,
buf
,
4
);
if
(
ret
==
0
)
{
ret
=
strncmp
(
"00001234567812345678"
,
buf
,
16
);
g_assert
(
ret
==
0
);
g_debug
(
"test-
dribb
lemode:%s: ragent recieved %d bytes : quit mainloop"
,
g_debug
(
"test-
trick
lemode:%s: ragent recieved %d bytes : quit mainloop"
,
G_STRFUNC
,
len
);
data_received
=
TRUE
;
g_cancellable_cancel
(
global_cancellable
);
...
...
@@ -317,7 +317,7 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
{
gint
ret
;
g_debug
(
"test-
dribb
lemode:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
lemode:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
{
global_lagent_state
=
state
;
...
...
@@ -349,7 +349,7 @@ static void swap_candidates(NiceAgent *local, guint local_id, NiceAgent *remote,
{
GSList
*
cands
=
NULL
;
g_debug
(
"test-
dribb
lemode:%s"
,
G_STRFUNC
);
g_debug
(
"test-
trick
lemode:%s"
,
G_STRFUNC
);
cands
=
nice_agent_get_local_candidates
(
local
,
local_id
,
NICE_COMPONENT_TYPE_RTP
);
g_assert
(
nice_agent_set_remote_candidates
(
remote
,
remote_id
,
...
...
@@ -376,7 +376,7 @@ static void cb_agent_new_candidate(NiceAgent *agent, guint stream_id, guint comp
gpointer
tmp
;
guint
id
;
g_debug
(
"test-
dribb
lemode:%s: %p"
,
G_STRFUNC
,
user_data
);
g_debug
(
"test-
trick
lemode:%s: %p"
,
G_STRFUNC
,
user_data
);
tmp
=
g_object_get_data
(
G_OBJECT
(
other
),
"id"
);
id
=
GPOINTER_TO_UINT
(
tmp
);
...
...
@@ -477,7 +477,7 @@ static void cleanup(NiceAgent *lagent, NiceAgent *ragent)
static
void
standard_test
(
NiceAgent
*
lagent
,
NiceAgent
*
ragent
)
{
g_debug
(
"test-
dribb
lemode:%s"
,
G_STRFUNC
);
g_debug
(
"test-
trick
lemode:%s"
,
G_STRFUNC
);
got_stun_packet
=
FALSE
;
init_test
(
lagent
,
ragent
,
FALSE
);
...
...
@@ -527,7 +527,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
static
void
bad_credentials_test
(
NiceAgent
*
lagent
,
NiceAgent
*
ragent
)
{
g_debug
(
"test-
dribb
lemode:%s"
,
G_STRFUNC
);
g_debug
(
"test-
trick
lemode:%s"
,
G_STRFUNC
);
init_test
(
lagent
,
ragent
,
FALSE
);
...
...
@@ -587,7 +587,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
{
NiceCandidate
*
cand
=
NULL
;
g_debug
(
"test-
dribb
lemode:%s"
,
G_STRFUNC
);
g_debug
(
"test-
trick
lemode:%s"
,
G_STRFUNC
);
init_test
(
lagent
,
ragent
,
FALSE
);
...
...
@@ -642,7 +642,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
static
void
new_candidate_test
(
NiceAgent
*
lagent
,
NiceAgent
*
ragent
)
{
g_debug
(
"test-
dribb
lemode:%s"
,
G_STRFUNC
);
g_debug
(
"test-
trick
lemode:%s"
,
G_STRFUNC
);
init_test
(
lagent
,
ragent
,
TRUE
);
swap_credentials
(
lagent
,
global_ls_id
,
ragent
,
global_rs_id
);
...
...
tests/test-
dribb
le.c
→
tests/test-
trick
le.c
View file @
9afd0c8b
/*
* This file is part of the Nice GLib ICE library.
*
* Unit test for ICE in
dribb
le mode (adding remote candidates while the
* Unit test for ICE in
trick
le mode (adding remote candidates while the
* machine is running).
*
* (C) 2007 Nokia Corporation. All rights reserved.
...
...
@@ -70,7 +70,7 @@ static void priv_print_global_status (void)
static
gboolean
timer_cb
(
gpointer
pointer
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
pointer
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
pointer
);
/* signal status via a global variable */
...
...
@@ -82,7 +82,7 @@ static gboolean timer_cb (gpointer pointer)
static
gboolean
quit_loop_cb
(
gpointer
pointer
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
pointer
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
pointer
);
g_main_loop_quit
(
global_mainloop
);
return
FALSE
;
...
...
@@ -90,7 +90,7 @@ static gboolean quit_loop_cb (gpointer pointer)
static
void
cb_nice_recv
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
guint
len
,
gchar
*
buf
,
gpointer
user_data
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
user_data
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
user_data
);
/* XXX: dear compiler, these are for you: */
(
void
)
agent
;
(
void
)
stream_id
;
(
void
)
component_id
;
(
void
)
buf
;
...
...
@@ -111,7 +111,7 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
static
void
cb_candidate_gathering_done
(
NiceAgent
*
agent
,
guint
stream_id
,
gpointer
data
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
global_lagent_gathering_done
=
TRUE
;
...
...
@@ -129,7 +129,7 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
static
void
cb_component_state_changed
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
guint
state
,
gpointer
data
)
{
gboolean
ready_to_connected
=
FALSE
;
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
{
if
(
global_lagent_state
==
NICE_COMPONENT_STATE_READY
&&
...
...
@@ -150,8 +150,8 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
if
(
state
==
NICE_COMPONENT_STATE_FAILED
)
global_components_failed
++
;
g_debug
(
"test-
dribb
le: checks READY/EXIT-AT %u/%u."
,
global_components_ready
,
global_components_ready_exit
);
g_debug
(
"test-
dribb
le: checks FAILED/EXIT-AT %u/%u."
,
global_components_failed
,
global_components_failed_exit
);
g_debug
(
"test-
trick
le: checks READY/EXIT-AT %u/%u."
,
global_components_ready
,
global_components_ready_exit
);
g_debug
(
"test-
trick
le: checks FAILED/EXIT-AT %u/%u."
,
global_components_failed
,
global_components_failed_exit
);
/* signal status via a global variable */
if
(
global_components_ready
==
global_components_ready_exit
&&
...
...
@@ -167,7 +167,7 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
static
void
cb_new_selected_pair
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
gchar
*
lfoundation
,
gchar
*
rfoundation
,
gpointer
data
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
++
global_lagent_cands
;
...
...
@@ -181,7 +181,7 @@ static void cb_new_selected_pair(NiceAgent *agent, guint stream_id, guint compon
static
void
cb_new_candidate
(
NiceAgent
*
agent
,
guint
stream_id
,
guint
component_id
,
gchar
*
foundation
,
gpointer
data
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
data
);
/* XXX: dear compiler, these are for you: */
(
void
)
agent
;
(
void
)
stream_id
;
(
void
)
data
;
(
void
)
component_id
;
(
void
)
foundation
;
...
...
@@ -189,7 +189,7 @@ static void cb_new_candidate(NiceAgent *agent, guint stream_id, guint component_
static
void
cb_initial_binding_request_received
(
NiceAgent
*
agent
,
guint
stream_id
,
gpointer
data
)
{
g_debug
(
"test-
dribb
le:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-
trick
le:%s: %p"
,
G_STRFUNC
,
data
);
if
(
GPOINTER_TO_UINT
(
data
)
==
1
)
global_lagent_ibr_received
=
TRUE
;
...
...
@@ -255,7 +255,7 @@ int main (void)
GUINT_TO_POINTER
(
2
));
/* step: run test */
g_debug
(
"test-
dribb
le: running test"
);
g_debug
(
"test-
trick
le: running test"
);
/* step: initialize variables modified by the callbacks */
global_components_ready
=
0
;
...
...
@@ -306,7 +306,7 @@ int main (void)
* (see timer_cb() above) */
if
(
global_lagent_gathering_done
!=
TRUE
||
global_ragent_gathering_done
!=
TRUE
)
{
g_debug
(
"test-
dribb
le: Added streams, running mainloop until 'candidate-gathering-done'..."
);
g_debug
(
"test-
trick
le: Added streams, running mainloop until 'candidate-gathering-done'..."
);
g_main_loop_run
(
global_mainloop
);
g_assert
(
global_lagent_gathering_done
==
TRUE
);
g_assert
(
global_ragent_gathering_done
==
TRUE
);
...
...
@@ -336,7 +336,7 @@ int main (void)
nice_candidate_free
((
NiceCandidate
*
)
i
->
data
);
g_slist_free
(
cands
);
g_debug
(
"test-
dribb
le: Set properties, next running mainloop until connectivity checks succeed..."
);
g_debug
(
"test-
trick
le: Set properties, next running mainloop until connectivity checks succeed..."
);
/* step: run the mainloop until connectivity checks succeed
* (see timer_cb() above) */
...
...
@@ -352,7 +352,7 @@ int main (void)
g_assert
(
global_lagent_cands
==
1
);
g_assert
(
global_ragent_cands
==
1
);
g_debug
(
"test-
dribb
le: agents are ready.. now adding new buggy candidate"
);
g_debug
(
"test-
trick
le: agents are ready.. now adding new buggy candidate"
);
g_timeout_add
(
500
,
quit_loop_cb
,
NULL
);
g_main_loop_run
(
global_mainloop
);
...
...
@@ -371,7 +371,7 @@ int main (void)
g_assert
(
global_lagent_state
==
NICE_COMPONENT_STATE_READY
);
/*
g_debug ("test-
dribb
le: buggy candidate worked, testing lower priority cand");
g_debug ("test-
trick
le: buggy candidate worked, testing lower priority cand");
cands = nice_agent_get_local_candidates (ragent, rs_id, NICE_COMPONENT_TYPE_RTP);
nice_address_set_port(&((NiceCandidate *) cands->data)->addr, 80);
...
...
@@ -389,7 +389,7 @@ int main (void)
g_main_loop_run
(
global_mainloop
);
g_assert
(
global_ragent_read
==
16
);
g_debug
(
"test-
dribb
le: Ran mainloop, removing streams..."
);
g_debug
(
"test-
trick
le: Ran mainloop, removing streams..."
);
/* step: clean up resources and exit */
...
...
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