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
bc140489
Commit
bc140489
authored
Oct 29, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port tests to windows
parent
3c40f049
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
127 additions
and
39 deletions
+127
-39
agent/test-fallback.c
agent/test-fallback.c
+3
-2
agent/test-fullmode.c
agent/test-fullmode.c
+11
-10
agent/test-restart.c
agent/test-restart.c
+3
-3
agent/test-thread.c
agent/test-thread.c
+4
-4
stun/tests/test-bind.c
stun/tests/test-bind.c
+24
-2
stun/tests/test-conncheck.c
stun/tests/test-conncheck.c
+25
-2
stun/tests/test-format.c
stun/tests/test-format.c
+17
-2
stun/tests/test-parse.c
stun/tests/test-parse.c
+16
-4
stun/tests/test-turn.c
stun/tests/test-turn.c
+24
-2
tests/Makefile.am
tests/Makefile.am
+0
-8
No files found.
agent/test-fallback.c
View file @
bc140489
...
@@ -39,11 +39,12 @@
...
@@ -39,11 +39,12 @@
# include <config.h>
# include <config.h>
#endif
#endif
#include "agent.h"
#include "agent-priv.h"
/* for testing purposes */
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "agent.h"
#include "agent-priv.h"
/* for testing purposes */
static
NiceComponentState
global_lagent_state
=
NICE_COMPONENT_STATE_LAST
;
static
NiceComponentState
global_lagent_state
=
NICE_COMPONENT_STATE_LAST
;
static
NiceComponentState
global_ragent_state
=
NICE_COMPONENT_STATE_LAST
;
static
NiceComponentState
global_ragent_state
=
NICE_COMPONENT_STATE_LAST
;
...
...
agent/test-fullmode.c
View file @
bc140489
...
@@ -38,10 +38,11 @@
...
@@ -38,10 +38,11 @@
# include <config.h>
# include <config.h>
#endif
#endif
#include "agent.h"
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "agent.h"
#define USE_TURN 0
#define USE_TURN 0
#define USE_LOOPBACK 1
#define USE_LOOPBACK 1
...
@@ -127,7 +128,7 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
...
@@ -127,7 +128,7 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
if
(
strncmp
(
"12345678"
,
buf
,
8
))
if
(
strncmp
(
"12345678"
,
buf
,
8
))
return
;
return
;
if
((
int
ptr_t
)
user_data
==
2
)
{
if
((
int
)
user_data
==
2
)
{
global_ragent_read
=
len
;
global_ragent_read
=
len
;
g_main_loop_quit
(
global_mainloop
);
g_main_loop_quit
(
global_mainloop
);
}
}
...
@@ -137,9 +138,9 @@ static void cb_candidate_gathering_done(NiceAgent *agent, gpointer data)
...
@@ -137,9 +138,9 @@ static void cb_candidate_gathering_done(NiceAgent *agent, gpointer data)
{
{
g_debug
(
"test-fullmode:%s: %p"
,
G_STRFUNC
,
data
);
g_debug
(
"test-fullmode:%s: %p"
,
G_STRFUNC
,
data
);
if
((
int
ptr_t
)
data
==
1
)
if
((
int
)
data
==
1
)
global_lagent_gathering_done
=
TRUE
;
global_lagent_gathering_done
=
TRUE
;
else
if
((
int
ptr_t
)
data
==
2
)
else
if
((
int
)
data
==
2
)
global_ragent_gathering_done
=
TRUE
;
global_ragent_gathering_done
=
TRUE
;
if
(
global_lagent_gathering_done
&&
if
(
global_lagent_gathering_done
&&
...
@@ -154,9 +155,9 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
...
@@ -154,9 +155,9 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
{
{
g_debug
(
"test-fullmode:%s: %p"
,
__func__
,
data
);
g_debug
(
"test-fullmode:%s: %p"
,
__func__
,
data
);
if
((
int
ptr_t
)
data
==
1
)
if
((
int
)
data
==
1
)
global_lagent_state
[
component_id
-
1
]
=
state
;
global_lagent_state
[
component_id
-
1
]
=
state
;
else
if
((
int
ptr_t
)
data
==
2
)
else
if
((
int
)
data
==
2
)
global_ragent_state
[
component_id
-
1
]
=
state
;
global_ragent_state
[
component_id
-
1
]
=
state
;
if
(
state
==
NICE_COMPONENT_STATE_READY
)
if
(
state
==
NICE_COMPONENT_STATE_READY
)
...
@@ -191,9 +192,9 @@ static void cb_new_selected_pair(NiceAgent *agent, guint stream_id, guint compon
...
@@ -191,9 +192,9 @@ static void cb_new_selected_pair(NiceAgent *agent, guint stream_id, guint compon
{
{
g_debug
(
"test-fullmode:%s: %p"
,
__func__
,
data
);
g_debug
(
"test-fullmode:%s: %p"
,
__func__
,
data
);
if
((
int
ptr_t
)
data
==
1
)
if
((
int
)
data
==
1
)
++
global_lagent_cands
;
++
global_lagent_cands
;
else
if
((
int
ptr_t
)
data
==
2
)
else
if
((
int
)
data
==
2
)
++
global_ragent_cands
;
++
global_ragent_cands
;
/* XXX: dear compiler, these are for you: */
/* XXX: dear compiler, these are for you: */
...
@@ -213,9 +214,9 @@ static void cb_initial_binding_request_received(NiceAgent *agent, guint stream_i
...
@@ -213,9 +214,9 @@ static void cb_initial_binding_request_received(NiceAgent *agent, guint stream_i
{
{
g_debug
(
"test-fullmode:%s: %p"
,
__func__
,
data
);
g_debug
(
"test-fullmode:%s: %p"
,
__func__
,
data
);
if
((
int
ptr_t
)
data
==
1
)
if
((
int
)
data
==
1
)
global_lagent_ibr_received
=
TRUE
;
global_lagent_ibr_received
=
TRUE
;
else
if
((
int
ptr_t
)
data
==
2
)
else
if
((
int
)
data
==
2
)
global_ragent_ibr_received
=
TRUE
;
global_ragent_ibr_received
=
TRUE
;
if
(
global_exit_when_ibr_received
)
if
(
global_exit_when_ibr_received
)
...
...
agent/test-restart.c
View file @
bc140489
...
@@ -36,12 +36,12 @@
...
@@ -36,12 +36,12 @@
# include <config.h>
# include <config.h>
#endif
#endif
#include <stdlib.h>
#include <string.h>
#include "agent.h"
#include "agent.h"
#include "agent-priv.h"
/* for testing purposes */
#include "agent-priv.h"
/* for testing purposes */
#include <stdlib.h>
#include <string.h>
static
NiceComponentState
global_lagent_state
=
NICE_COMPONENT_STATE_LAST
;
static
NiceComponentState
global_lagent_state
=
NICE_COMPONENT_STATE_LAST
;
static
NiceComponentState
global_ragent_state
=
NICE_COMPONENT_STATE_LAST
;
static
NiceComponentState
global_ragent_state
=
NICE_COMPONENT_STATE_LAST
;
static
guint
global_components_ready
=
0
;
static
guint
global_components_ready
=
0
;
...
...
agent/test-thread.c
View file @
bc140489
...
@@ -38,11 +38,11 @@
...
@@ -38,11 +38,11 @@
# include <config.h>
# include <config.h>
#endif
#endif
#include "agent.h"
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include "agent.h"
GMainLoop
*
error_loop
;
GMainLoop
*
error_loop
;
gint
global_lagent_cands
=
0
;
gint
global_lagent_cands
=
0
;
...
@@ -82,9 +82,9 @@ cb_new_selected_pair(NiceAgent *agent,
...
@@ -82,9 +82,9 @@ cb_new_selected_pair(NiceAgent *agent,
{
{
g_debug
(
"test-thread:%s: %p"
,
__func__
,
data
);
g_debug
(
"test-thread:%s: %p"
,
__func__
,
data
);
if
((
int
ptr_t
)
data
==
1
)
if
((
int
)
data
==
1
)
g_atomic_int_inc
(
&
global_lagent_cands
);
g_atomic_int_inc
(
&
global_lagent_cands
);
else
if
((
int
ptr_t
)
data
==
2
)
else
if
((
int
)
data
==
2
)
g_atomic_int_inc
(
&
global_ragent_cands
);
g_atomic_int_inc
(
&
global_ragent_cands
);
}
}
...
...
stun/tests/test-bind.c
View file @
bc140489
...
@@ -38,16 +38,38 @@
...
@@ -38,16 +38,38 @@
#endif
#endif
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "stun/stunagent.h"
#include "stun/stunagent.h"
#include "stun/usages/bind.h"
#include "stun/usages/bind.h"
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#define ENOENT -1
#define EINVAL -2
#define ENOBUFS -3
#define EAFNOSUPPORT -4
#define EPROTO -5
#define EACCES -6
#define EINPROGRESS -7
#define EAGAIN -8
#define ENOSYS -9
#define MSG_DONTWAIT 0
#define MSG_NOSIGNAL 0
#define alarm(...)
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netdb.h>
#include <errno.h>
#endif
#undef NDEBUG
/* ensure assertions are built-in */
#undef NDEBUG
/* ensure assertions are built-in */
#include <assert.h>
#include <assert.h>
...
...
stun/tests/test-conncheck.c
View file @
bc140489
...
@@ -38,16 +38,39 @@
...
@@ -38,16 +38,39 @@
#endif
#endif
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "stun/stunagent.h"
#include "stun/stunagent.h"
#include "stun/usages/ice.h"
#include "stun/usages/ice.h"
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <unistd.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#define ENOENT -1
#define EINVAL -2
#define ENOBUFS -3
#define EAFNOSUPPORT -4
#define EPROTO -5
#define EACCES -6
#define EINPROGRESS -7
#define EAGAIN -8
#define ENOSYS -9
#define MSG_DONTWAIT 0
#define MSG_NOSIGNAL 0
#define alarm(...)
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#endif
#undef NDEBUG
/* ensure assertions are built-in */
#undef NDEBUG
/* ensure assertions are built-in */
#include <assert.h>
#include <assert.h>
...
...
stun/tests/test-format.c
View file @
bc140489
...
@@ -38,7 +38,6 @@
...
@@ -38,7 +38,6 @@
#endif
#endif
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "stun/stunagent.h"
#include "stun/stunagent.h"
#include <stdio.h>
#include <stdio.h>
...
@@ -46,8 +45,24 @@
...
@@ -46,8 +45,24 @@
#include <stdlib.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdarg.h>
#include <assert.h>
#include <assert.h>
#ifdef _WIN32
#include <winsock2.h>
#define ENOENT -1
#define EINVAL -2
#define ENOBUFS -3
#define EAFNOSUPPORT -4
#define EPROTO -5
#define EACCES -6
#define EINPROGRESS -7
#define EAGAIN -8
#define ENOSYS -9
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
#include <errno.h>
#
include <netinet/in.h>
#
endif
static
void
fatal
(
const
char
*
msg
,
...)
static
void
fatal
(
const
char
*
msg
,
...)
...
...
stun/tests/test-parse.c
View file @
bc140489
...
@@ -37,17 +37,29 @@
...
@@ -37,17 +37,29 @@
# include <config.h>
# include <config.h>
#endif
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "stun/stunagent.h"
#include "stun/stunagent.h"
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdarg.h>
#ifdef _WIN32
#include <winsock2.h>
#define ENOENT -1
#define EINVAL -2
#define ENOBUFS -3
#define EAFNOSUPPORT -4
#define EPROTO -5
#define EACCES -6
#define EINPROGRESS -7
#define EAGAIN -8
#define ENOSYS -9
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
#include <errno.h>
#endif
# define STUN_MAX_STR (763u)
# define STUN_MAX_STR (763u)
...
...
stun/tests/test-turn.c
View file @
bc140489
...
@@ -38,16 +38,38 @@
...
@@ -38,16 +38,38 @@
#endif
#endif
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "stun/stunagent.h"
#include "stun/stunagent.h"
#include "stun/usages/turn.h"
#include "stun/usages/turn.h"
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#define ENOENT -1
#define EINVAL -2
#define ENOBUFS -3
#define EAFNOSUPPORT -4
#define EPROTO -5
#define EACCES -6
#define EINPROGRESS -7
#define EAGAIN -8
#define ENOSYS -9
#define MSG_DONTWAIT 0
#define MSG_NOSIGNAL 0
#define alarm(...)
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netdb.h>
#include <errno.h>
#endif
#undef NDEBUG
/* ensure assertions are built-in */
#undef NDEBUG
/* ensure assertions are built-in */
#include <assert.h>
#include <assert.h>
...
...
tests/Makefile.am
deleted
100644 → 0
View file @
3c40f049
#
# Makefile.am for the Nice Glib ICE library
#
# (C) 2006, 2007 Collabora Ltd.
# (C) 2006, 2007 Nokia Corporation. All rights reserved.
#
# Licensed under MPL 1.1/LGPL 2.1. See file COPYING.
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