summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test-add-remove-stream.c4
-rw-r--r--tests/test-address.c106
-rw-r--r--tests/test-bsd.c28
-rw-r--r--tests/test-build-io-stream.c100
-rw-r--r--tests/test-consent.c22
-rw-r--r--tests/test-credentials.c8
-rw-r--r--tests/test-different-number-streams.c10
-rw-r--r--tests/test-drop-invalid.c34
-rw-r--r--tests/test-fallback.c26
-rw-r--r--tests/test-fullmode.c56
-rw-r--r--tests/test-icetcp.c16
-rw-r--r--tests/test-interfaces.c14
-rw-r--r--tests/test-io-stream-common.c12
-rw-r--r--tests/test-new-trickle.c64
-rw-r--r--tests/test-nomination.c10
-rw-r--r--tests/test-pseudotcp-fin.c34
-rw-r--r--tests/test-pseudotcp-fuzzy.c6
-rw-r--r--tests/test-pseudotcp.c6
-rw-r--r--tests/test-restart.c22
-rw-r--r--tests/test-send-recv.c2
-rw-r--r--tests/test-set-port-range.c6
-rw-r--r--tests/test-socket-is-based-on.c32
-rw-r--r--tests/test-tcp.c28
-rw-r--r--tests/test-thread.c18
-rw-r--r--tests/test-trickle.c6
-rw-r--r--tests/test-turn.c14
-rw-r--r--tests/test.c16
27 files changed, 350 insertions, 350 deletions
diff --git a/tests/test-add-remove-stream.c b/tests/test-add-remove-stream.c
index 6df9dce..0b4f08e 100644
--- a/tests/test-add-remove-stream.c
+++ b/tests/test-add-remove-stream.c
@@ -65,13 +65,13 @@ main (void)
g_assert_cmpuint (nice_agent_add_stream (agent, 10), ==, 2);
g_assert_cmpuint (nice_agent_add_stream (agent, 2), ==, 3);
- g_assert (NULL != agent->streams);
+ g_assert_true (NULL != agent->streams);
nice_agent_remove_stream (agent, 1);
nice_agent_remove_stream (agent, 2);
nice_agent_remove_stream (agent, 3);
- g_assert (NULL == agent->streams);
+ g_assert_true (NULL == agent->streams);
g_object_unref (agent);
#ifdef G_OS_WIN32
diff --git a/tests/test-address.c b/tests/test-address.c
index 583830e..4b874c8 100644
--- a/tests/test-address.c
+++ b/tests/test-address.c
@@ -61,7 +61,7 @@ test_ipv4 (void)
/* same address */
nice_address_set_ipv4 (&other, 0x01020304);
- g_assert (TRUE == nice_address_equal (&addr, &other));
+ g_assert_true (TRUE == nice_address_equal (&addr, &other));
/* from sockaddr_in */
nice_address_set_port (&other, 9876); /* in native byte order */
@@ -70,84 +70,84 @@ test_ipv4 (void)
nice_address_set_port (&addr, 9876); /* in native byte order */
nice_address_to_string (&addr, str);
nice_address_to_string (&other, str);
- g_assert (TRUE == nice_address_equal (&addr, &other));
+ g_assert_true (TRUE == nice_address_equal (&addr, &other));
/* different IP */
nice_address_set_ipv4 (&other, 0x01020305);
- g_assert (FALSE == nice_address_equal (&addr, &other));
+ g_assert_true (FALSE == nice_address_equal (&addr, &other));
/* different port */
nice_address_set_ipv4 (&other, 0x01020304);
nice_address_set_port (&addr, 1);
- g_assert (FALSE == nice_address_equal (&addr, &other));
+ g_assert_true (FALSE == nice_address_equal (&addr, &other));
/* test private address check */
{
NiceAddress *heap_addr = nice_address_new ();
- g_assert (nice_address_set_from_string (heap_addr, "127.0.0.1.1") != TRUE);
+ g_assert_true (nice_address_set_from_string (heap_addr, "127.0.0.1.1") != TRUE);
- g_assert (nice_address_set_from_string (heap_addr, "127.0.0.1") == TRUE);
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string (heap_addr, "127.0.0.1") == TRUE);
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string (heap_addr, "127.1.1.1") == TRUE);
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string (heap_addr, "127.1.1.1") == TRUE);
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "192.168.2.0"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "192.168.2.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "192.168.15.69"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "192.168.15.69"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "192.169.0.0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "192.169.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "192.167.0.0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "192.167.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "10.2.1.2"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "10.2.1.2"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "11.0.0.0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "11.0.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "9.255.255.255"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "9.255.255.255"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "172.15.255.255"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "172.15.255.255"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "172.16.0.0"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "172.16.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "172.31.255.255"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "172.31.255.255"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "172.32.0.0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "172.63.0.0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "172.32.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "172.63.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "169.253.255.255"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "169.253.255.255"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "169.254.0.0"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "169.254.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "169.254.255.255"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "169.254.255.255"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "169.255.0.0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "169.255.0.0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "fe70::0"));
- g_assert (nice_address_is_private (heap_addr) == FALSE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "fe70::0"));
+ g_assert_true (nice_address_is_private (heap_addr) == FALSE);
- g_assert (nice_address_set_from_string(heap_addr, "fe80::0"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "fe80::0"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
- g_assert (nice_address_set_from_string(heap_addr, "fe81::0"));
- g_assert (nice_address_is_private (heap_addr) == TRUE);
+ g_assert_true (nice_address_set_from_string(heap_addr, "fe81::0"));
+ g_assert_true (nice_address_is_private (heap_addr) == TRUE);
nice_address_free (heap_addr);
}
@@ -163,7 +163,7 @@ test_ipv6 (void)
struct sockaddr addr;
} sin, sin2;
- g_assert (nice_address_set_from_string (&v4addr, "172.1.0.1") == TRUE);
+ g_assert_true (nice_address_set_from_string (&v4addr, "172.1.0.1") == TRUE);
memset (&sin, 0, sizeof (sin));
memset (&sin2, 0, sizeof (sin2));
@@ -188,7 +188,7 @@ test_ipv6 (void)
nice_address_copy_to_sockaddr (&other, &sin2.addr);
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_address_equal (&addr, &other) == TRUE);
+ g_assert_true (nice_address_equal (&addr, &other) == TRUE);
nice_address_to_string (&addr, str);
nice_address_to_string (&other, str);
@@ -200,20 +200,20 @@ test_ipv6 (void)
"\x00\x00\x00\x00"
"\x00\x00\x00\x00"
"\x00\x00\x00\x01");
- g_assert (nice_address_is_private (&addr) == TRUE);
+ g_assert_true (nice_address_is_private (&addr) == TRUE);
nice_address_set_ipv6 (&addr, (guchar *)
"\x00\x00\x00\x00"
"\x00\x00\x00\x00"
"\x00\x00\x00\x00"
"\x00\x00\x00\x01");
- g_assert (nice_address_is_private (&addr) == TRUE);
+ g_assert_true (nice_address_is_private (&addr) == TRUE);
/* mismatching address families */
- g_assert (nice_address_equal (&addr, &v4addr) != TRUE);
+ g_assert_true (nice_address_equal (&addr, &v4addr) != TRUE);
/* mismatched type */
addr.s.addr.sa_family = AF_UNSPEC;
- /*g_assert (nice_address_equal (&addr, &v4addr) != TRUE);*/
+ /*g_assert_true (nice_address_equal (&addr, &v4addr) != TRUE);*/
}
int
diff --git a/tests/test-bsd.c b/tests/test-bsd.c
index 6538a2f..f8185a5 100644
--- a/tests/test-bsd.c
+++ b/tests/test-bsd.c
@@ -65,7 +65,7 @@ test_socket_initial_properties (void)
sock = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (sock != NULL);
+ g_assert_true (sock != NULL);
// not bound to a particular interface
g_assert_cmpint (sock->addr.s.ip4.sin_addr.s_addr, ==, 0);
@@ -84,9 +84,9 @@ test_socket_address_properties (void)
sock = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (sock != NULL);
+ g_assert_true (sock != NULL);
- g_assert (nice_address_set_from_string (&tmp, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&tmp, "127.0.0.1"));
g_assert_cmpuint (nice_address_get_port (&sock->addr), !=, 0);
nice_address_set_port (&tmp, nice_address_get_port (&sock->addr));
g_assert_cmpuint (nice_address_get_port (&tmp), !=, 0);
@@ -105,13 +105,13 @@ test_simple_send_recv (void)
server = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (server != NULL);
+ g_assert_true (server != NULL);
client = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (client != NULL);
+ g_assert_true (client != NULL);
- g_assert (nice_address_set_from_string (&tmp, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&tmp, "127.0.0.1"));
nice_address_set_port (&tmp, nice_address_get_port (&server->addr));
/* Send and receive stuff. */
@@ -143,9 +143,9 @@ test_zero_send_recv (void)
sock = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (sock != NULL);
+ g_assert_true (sock != NULL);
- g_assert (nice_address_set_from_string (&tmp, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&tmp, "127.0.0.1"));
g_assert_cmpuint (nice_address_get_port (&sock->addr), !=, 0);
nice_address_set_port (&tmp, nice_address_get_port (&sock->addr));
g_assert_cmpuint (nice_address_get_port (&tmp), !=, 0);
@@ -181,13 +181,13 @@ test_multi_buffer_recv (void)
server = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (server != NULL);
+ g_assert_true (server != NULL);
client = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (client != NULL);
+ g_assert_true (client != NULL);
- g_assert (nice_address_set_from_string (&tmp, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&tmp, "127.0.0.1"));
nice_address_set_port (&tmp, nice_address_get_port (&server->addr));
/* Send and receive stuff. */
@@ -255,13 +255,13 @@ test_multi_message_recv (guint n_sends, guint n_receives,
server = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (server != NULL);
+ g_assert_true (server != NULL);
client = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
- g_assert (client != NULL);
+ g_assert_true (client != NULL);
- g_assert (nice_address_set_from_string (&tmp, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&tmp, "127.0.0.1"));
nice_address_set_port (&tmp, nice_address_get_port (&server->addr));
/* Send and receive stuff. */
diff --git a/tests/test-build-io-stream.c b/tests/test-build-io-stream.c
index 195a8a9..a968534 100644
--- a/tests/test-build-io-stream.c
+++ b/tests/test-build-io-stream.c
@@ -57,7 +57,7 @@ test_invalid_stream (NiceAddress *addr)
/* Try building an I/O stream for an invalid stream. All its operations should
* return G_IO_ERROR_BROKEN_PIPE. */
io_stream = nice_agent_get_io_stream (agent, 5, 5);
- g_assert (io_stream == NULL);
+ g_assert_true (io_stream == NULL);
g_object_unref (agent);
}
@@ -79,36 +79,36 @@ test_io_stream_properties (NiceAddress *addr)
/* Try building an I/O stream around it. */
io_stream = nice_agent_get_io_stream (agent, stream_id, 1);
- g_assert (G_IS_IO_STREAM (io_stream));
- g_assert (NICE_IS_IO_STREAM (io_stream));
+ g_assert_true (G_IS_IO_STREAM (io_stream));
+ g_assert_true (NICE_IS_IO_STREAM (io_stream));
/* Check various initial properties. */
- g_assert (!g_io_stream_is_closed (G_IO_STREAM (io_stream)));
- g_assert (!g_io_stream_has_pending (G_IO_STREAM (io_stream)));
+ g_assert_true (!g_io_stream_is_closed (G_IO_STREAM (io_stream)));
+ g_assert_true (!g_io_stream_has_pending (G_IO_STREAM (io_stream)));
/* Check the input stream’s properties. */
input_stream = g_io_stream_get_input_stream (G_IO_STREAM (io_stream));
- g_assert (G_IS_INPUT_STREAM (input_stream));
- g_assert (NICE_IS_INPUT_STREAM (input_stream));
+ g_assert_true (G_IS_INPUT_STREAM (input_stream));
+ g_assert_true (NICE_IS_INPUT_STREAM (input_stream));
- g_assert (!g_input_stream_is_closed (input_stream));
- g_assert (!g_input_stream_has_pending (input_stream));
+ g_assert_true (!g_input_stream_is_closed (input_stream));
+ g_assert_true (!g_input_stream_has_pending (input_stream));
/* Check the output stream’s properties. */
output_stream = g_io_stream_get_output_stream (G_IO_STREAM (io_stream));
- g_assert (G_IS_OUTPUT_STREAM (output_stream));
- g_assert (NICE_IS_OUTPUT_STREAM (output_stream));
+ g_assert_true (G_IS_OUTPUT_STREAM (output_stream));
+ g_assert_true (NICE_IS_OUTPUT_STREAM (output_stream));
- g_assert (!g_output_stream_is_closing (output_stream));
- g_assert (!g_output_stream_is_closed (output_stream));
- g_assert (!g_output_stream_has_pending (output_stream));
+ g_assert_true (!g_output_stream_is_closing (output_stream));
+ g_assert_true (!g_output_stream_is_closed (output_stream));
+ g_assert_true (!g_output_stream_has_pending (output_stream));
/* Remove the component and check that the I/O streams close. */
nice_agent_remove_stream (agent, stream_id);
- g_assert (g_io_stream_is_closed (G_IO_STREAM (io_stream)));
- g_assert (g_input_stream_is_closed (input_stream));
- g_assert (g_output_stream_is_closed (output_stream));
+ g_assert_true (g_io_stream_is_closed (G_IO_STREAM (io_stream)));
+ g_assert_true (g_input_stream_is_closed (input_stream));
+ g_assert_true (g_output_stream_is_closed (output_stream));
g_object_unref (io_stream);
g_object_unref (agent);
@@ -137,18 +137,18 @@ test_pollable_properties (NiceAddress *addr)
/* Try building an I/O stream around it. */
io_stream = nice_agent_get_io_stream (agent, stream_id, 1);
- g_assert (G_IS_IO_STREAM (io_stream));
- g_assert (NICE_IS_IO_STREAM (io_stream));
+ g_assert_true (G_IS_IO_STREAM (io_stream));
+ g_assert_true (NICE_IS_IO_STREAM (io_stream));
/* Check the input stream’s properties. */
input_stream = g_io_stream_get_input_stream (G_IO_STREAM (io_stream));
- g_assert (G_IS_POLLABLE_INPUT_STREAM (input_stream));
+ g_assert_true (G_IS_POLLABLE_INPUT_STREAM (input_stream));
pollable_input_stream = G_POLLABLE_INPUT_STREAM (input_stream);
- g_assert (g_pollable_input_stream_can_poll (pollable_input_stream));
- g_assert (!g_pollable_input_stream_is_readable (pollable_input_stream));
+ g_assert_true (g_pollable_input_stream_can_poll (pollable_input_stream));
+ g_assert_true (!g_pollable_input_stream_is_readable (pollable_input_stream));
- g_assert (
+ g_assert_true (
g_pollable_input_stream_read_nonblocking (pollable_input_stream,
buf, sizeof (buf), NULL, &error) == -1);
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK);
@@ -156,18 +156,18 @@ test_pollable_properties (NiceAddress *addr)
stream_source =
g_pollable_input_stream_create_source (pollable_input_stream, NULL);
- g_assert (stream_source != NULL);
+ g_assert_true (stream_source != NULL);
g_source_unref (stream_source);
/* Check the output stream’s properties. */
output_stream = g_io_stream_get_output_stream (G_IO_STREAM (io_stream));
- g_assert (G_IS_POLLABLE_OUTPUT_STREAM (output_stream));
+ g_assert_true (G_IS_POLLABLE_OUTPUT_STREAM (output_stream));
pollable_output_stream = G_POLLABLE_OUTPUT_STREAM (output_stream);
- g_assert (g_pollable_output_stream_can_poll (pollable_output_stream));
- g_assert (!g_pollable_output_stream_is_writable (pollable_output_stream));
+ g_assert_true (g_pollable_output_stream_can_poll (pollable_output_stream));
+ g_assert_true (!g_pollable_output_stream_is_writable (pollable_output_stream));
- g_assert (
+ g_assert_true (
g_pollable_output_stream_write_nonblocking (pollable_output_stream,
buf, sizeof (buf), NULL, &error) == -1);
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK);
@@ -175,21 +175,21 @@ test_pollable_properties (NiceAddress *addr)
stream_source =
g_pollable_output_stream_create_source (pollable_output_stream, NULL);
- g_assert (stream_source != NULL);
+ g_assert_true (stream_source != NULL);
g_source_unref (stream_source);
/* Remove the component and check that the I/O streams close. */
nice_agent_remove_stream (agent, stream_id);
- g_assert (!g_pollable_input_stream_is_readable (pollable_input_stream));
- g_assert (!g_pollable_output_stream_is_writable (pollable_output_stream));
+ g_assert_true (!g_pollable_input_stream_is_readable (pollable_input_stream));
+ g_assert_true (!g_pollable_output_stream_is_writable (pollable_output_stream));
- g_assert (
+ g_assert_true (
g_pollable_input_stream_read_nonblocking (pollable_input_stream,
buf, sizeof (buf), NULL, &error) == 0);
g_assert_no_error (error);
- g_assert (
+ g_assert_true (
g_pollable_output_stream_write_nonblocking (pollable_output_stream,
buf, sizeof (buf), NULL, &error) == -1);
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CLOSED);
@@ -217,11 +217,11 @@ source_cancelled_cb (GObject *pollable_stream, gpointer user_data)
/* Try and check that the callback was invoked due to cancellation rather than
* a poll() event on the socket itself. */
if (G_IS_POLLABLE_INPUT_STREAM (pollable_stream)) {
- g_assert (
+ g_assert_true (
!g_pollable_input_stream_is_readable (
G_POLLABLE_INPUT_STREAM (pollable_stream)));
} else {
- g_assert (
+ g_assert_true (
!g_pollable_output_stream_is_writable (
G_POLLABLE_OUTPUT_STREAM (pollable_stream)));
}
@@ -278,7 +278,7 @@ check_pollable_source_cancellation (GSource *pollable_source,
* is cancelled. */
g_main_loop_run (main_loop);
- g_assert (g_cancellable_is_cancelled (cancellable));
+ g_assert_true (g_cancellable_is_cancelled (cancellable));
g_main_loop_unref (main_loop);
g_main_context_unref (main_context);
@@ -308,16 +308,16 @@ test_pollable_cancellation (NiceAddress *addr)
/* Try building an I/O stream around it. */
io_stream = nice_agent_get_io_stream (agent, stream_id, 1);
- g_assert (G_IS_IO_STREAM (io_stream));
- g_assert (NICE_IS_IO_STREAM (io_stream));
+ g_assert_true (G_IS_IO_STREAM (io_stream));
+ g_assert_true (NICE_IS_IO_STREAM (io_stream));
/* Grab the input and output streams. */
input_stream = g_io_stream_get_input_stream (G_IO_STREAM (io_stream));
- g_assert (G_IS_POLLABLE_INPUT_STREAM (input_stream));
+ g_assert_true (G_IS_POLLABLE_INPUT_STREAM (input_stream));
pollable_input_stream = G_POLLABLE_INPUT_STREAM (input_stream);
output_stream = g_io_stream_get_output_stream (G_IO_STREAM (io_stream));
- g_assert (G_IS_POLLABLE_OUTPUT_STREAM (output_stream));
+ g_assert_true (G_IS_POLLABLE_OUTPUT_STREAM (output_stream));
pollable_output_stream = G_POLLABLE_OUTPUT_STREAM (output_stream);
/* Check the non-blocking read() and write() return immediately if called with
@@ -325,13 +325,13 @@ test_pollable_cancellation (NiceAddress *addr)
cancellable = g_cancellable_new ();
g_cancellable_cancel (cancellable);
- g_assert (
+ g_assert_true (
g_pollable_input_stream_read_nonblocking (pollable_input_stream,
buf, sizeof (buf), cancellable, &error) == -1);
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
g_clear_error (&error);
- g_assert (
+ g_assert_true (
g_pollable_output_stream_write_nonblocking (pollable_output_stream,
buf, sizeof (buf), cancellable, &error) == -1);
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
@@ -387,8 +387,8 @@ test_zero_length_reads_writes (NiceAddress *addr)
/* Try building an I/O stream around it. */
io_stream = nice_agent_get_io_stream (agent, stream_id, 1);
- g_assert (G_IS_IO_STREAM (io_stream));
- g_assert (NICE_IS_IO_STREAM (io_stream));
+ g_assert_true (G_IS_IO_STREAM (io_stream));
+ g_assert_true (NICE_IS_IO_STREAM (io_stream));
input_stream = g_io_stream_get_input_stream (G_IO_STREAM (io_stream));
output_stream = g_io_stream_get_output_stream (G_IO_STREAM (io_stream));
@@ -402,12 +402,12 @@ test_zero_length_reads_writes (NiceAddress *addr)
g_assert_cmpint (g_output_stream_write (output_stream, buf, 0, NULL, &error), ==, 0);
g_assert_no_error (error);
- g_assert (
+ g_assert_true (
g_pollable_input_stream_read_nonblocking (pollable_input_stream,
buf, 0, NULL, &error) == 0);
g_assert_no_error (error);
- g_assert (
+ g_assert_true (
g_pollable_output_stream_write_nonblocking (pollable_output_stream,
buf, 0, NULL, &error) == 0);
g_assert_no_error (error);
@@ -415,7 +415,7 @@ test_zero_length_reads_writes (NiceAddress *addr)
/* Remove the component and check that zero-length reads and writes still
* result in a 0 response, rather than any error. */
nice_agent_remove_stream (agent, stream_id);
- g_assert (g_io_stream_is_closed (G_IO_STREAM (io_stream)));
+ g_assert_true (g_io_stream_is_closed (G_IO_STREAM (io_stream)));
g_assert_cmpint (g_input_stream_read (input_stream, buf, 0, NULL, &error), ==, 0);
g_assert_no_error (error);
@@ -423,12 +423,12 @@ test_zero_length_reads_writes (NiceAddress *addr)
g_assert_cmpint (g_output_stream_write (output_stream, buf, 0, NULL, &error), ==, 0);
g_assert_no_error (error);
- g_assert (
+ g_assert_true (
g_pollable_input_stream_read_nonblocking (pollable_input_stream,
buf, 0, NULL, &error) == 0);
g_assert_no_error (error);
- g_assert (
+ g_assert_true (
g_pollable_output_stream_write_nonblocking (pollable_output_stream,
buf, 0, NULL, &error) == 0);
g_assert_no_error (error);
@@ -448,7 +448,7 @@ main (void)
#endif
nice_address_init (&addr);
- g_assert (nice_address_set_from_string (&addr, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&addr, "127.0.0.1"));
test_invalid_stream (&addr);
test_io_stream_properties (&addr);
diff --git a/tests/test-consent.c b/tests/test-consent.c
index dbf4741..7377a9a 100644
--- a/tests/test-consent.c
+++ b/tests/test-consent.c
@@ -197,7 +197,7 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
for (i = cands; i; i = i->next) {
NiceCandidate *cand = i->data;
if (cand) {
- g_assert (dstaddr);
+ g_assert_true (dstaddr);
*dstaddr = cand->addr;
}
}
@@ -264,8 +264,8 @@ static int run_consent_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
global_ragent_gathering_done != TRUE) {
g_debug ("test-consent: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
/* step: find out the local candidates of each agent */
@@ -319,8 +319,8 @@ static int run_consent_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
g_main_loop_run (global_mainloop);
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* note: verify that correct number of local candidates were reported */
g_assert_cmpint (global_lagent_cands, ==, 2);
g_assert_cmpint (global_ragent_cands, ==, 2);
@@ -336,12 +336,12 @@ static int run_consent_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
global_components_failed = 0;
/* step: synthesize marking the components as consent failed */
- g_assert (nice_agent_consent_lost (ragent, rs_id, NICE_COMPONENT_TYPE_RTP));
- g_assert (nice_agent_consent_lost (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP));
+ g_assert_true (nice_agent_consent_lost (ragent, rs_id, NICE_COMPONENT_TYPE_RTP));
+ g_assert_true (nice_agent_consent_lost (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP));
/* step: synthesize marking the components as consent failed */
- g_assert (nice_agent_consent_lost (lagent, rs_id, NICE_COMPONENT_TYPE_RTP));
- g_assert (nice_agent_consent_lost (lagent, rs_id, NICE_COMPONENT_TYPE_RTCP));
+ g_assert_true (nice_agent_consent_lost (lagent, rs_id, NICE_COMPONENT_TYPE_RTP));
+ g_assert_true (nice_agent_consent_lost (lagent, rs_id, NICE_COMPONENT_TYPE_RTCP));
/* transition to failed will take roughly 4-6 seconds as that's the pacing
* of the consent connection checks */
@@ -401,8 +401,8 @@ static int run_consent_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
g_main_loop_run (global_mainloop);
/* note: verify binding requests were resent after restart */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* send another packet after consent lost and after ice restart that will succeed */
g_assert_cmpint (nice_agent_send (lagent, ls_id, 1, 16, "1234567812345678"), ==, 16);
diff --git a/tests/test-credentials.c b/tests/test-credentials.c
index d11da6d..d00cea9 100644
--- a/tests/test-credentials.c
+++ b/tests/test-credentials.c
@@ -78,7 +78,7 @@ static void swap_candidates(NiceAgent *local, guint local_id, NiceAgent *remote,
g_debug ("test-credentials:%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,
+ g_assert_true (nice_agent_set_remote_candidates(remote, remote_id,
NICE_COMPONENT_TYPE_RTP, cands));
g_slist_free_full (cands, (GDestroyNotify) nice_candidate_free);
@@ -121,11 +121,11 @@ static void setup(NiceAgent *lagent, NiceAgent *ragent)
g_assert_cmpuint (nice_agent_add_stream (lagent, 1), ==, 1);
g_assert_cmpuint (nice_agent_add_stream (ragent, 1), ==, 1);
- g_assert (NULL != lagent->streams);
- g_assert (NULL != ragent->streams);
+ g_assert_true (NULL != lagent->streams);
+ g_assert_true (NULL != ragent->streams);
nice_address_init (&addr);
- g_assert (nice_address_set_from_string (&addr, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&addr, "127.0.0.1"));
nice_agent_add_local_address (lagent, &addr);
nice_agent_add_local_address (ragent, &addr);
diff --git a/tests/test-different-number-streams.c b/tests/test-different-number-streams.c
index 81be822..c0d5599 100644
--- a/tests/test-different-number-streams.c
+++ b/tests/test-different-number-streams.c
@@ -144,9 +144,9 @@ int main (void)
nice_agent_set_remote_credentials (ragent, rs_id_2, lufrag, lpassword);
nice_agent_set_remote_credentials (lagent, ls_id, rufrag2, rpassword2);
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id_2) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id_1) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id_2) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id_1) == TRUE);
if (USE_SECOND_STREAM) {
set_candidates (ragent, rs_id_2, lagent, ls_id, NICE_COMPONENT_TYPE_RTP);
@@ -177,8 +177,8 @@ int main (void)
nice_agent_set_remote_credentials (ragent, rs_id_1, lufrag, lpassword);
nice_agent_set_remote_credentials (lagent, ls_id, rufrag1, rpassword1);
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id_1) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id_1) == TRUE);
/* step: attach to mainloop (needed to register the fds) */
nice_agent_attach_recv (ragent, rs_id_1, NICE_COMPONENT_TYPE_RTP,
diff --git a/tests/test-drop-invalid.c b/tests/test-drop-invalid.c
index a484c2d..1a859b7 100644
--- a/tests/test-drop-invalid.c
+++ b/tests/test-drop-invalid.c
@@ -98,7 +98,7 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
* send before the negotiation is over.
*/
g_assert_cmpuint (len, ==, 16);
- g_assert (strncmp ("1234567812345678", buf, 16) == 0);
+ g_assert_true (strncmp ("1234567812345678", buf, 16) == 0);
if (component_id == 2)
return;
@@ -227,7 +227,7 @@ static void set_candidates (NiceAgent *from, guint from_stream,
NiceCandidateImpl *cand = item1->data;
NiceSocket *nicesock = cand->sockptr;
- g_assert (nicesock);
+ g_assert_true (nicesock);
for (item2 = peer_cands; item2; item2 = item2->next) {
NiceCandidate *target_cand = item2->data;
@@ -266,14 +266,14 @@ get_port (NiceAgent *agent, guint stream_id, guint component_id)
GSList *item;
guint16 port = 0;
- g_assert (cands != NULL);
+ g_assert_true (cands != NULL);
for (item = cands; item; item = item->next) {
NiceCandidate *cand = item->data;
port = nice_address_get_port (&cand->addr);
break;
}
- g_assert (port != 0);
+ g_assert_true (port != 0);
g_slist_free_full (cands, (GDestroyNotify) nice_candidate_free);
@@ -314,16 +314,16 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
/* Gather candidates and test nice_agent_set_port_range */
nice_agent_set_port_range (lagent, ls_id, 1, 10000, 11000);
nice_agent_set_port_range (lagent, ls_id, 2, 11000, 12000);
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
port = get_port (lagent, ls_id, 1);
nice_agent_set_port_range (ragent, rs_id, 1, 12000, 13000);
nice_agent_set_port_range (ragent, rs_id, 2, port, port);
- 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);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == FALSE);
+ g_assert_true (nice_agent_get_local_candidates (ragent, rs_id, 1) == NULL);
+ g_assert_true (nice_agent_get_local_candidates (ragent, rs_id, 2) == NULL);
nice_agent_set_port_range (ragent, rs_id, 2, 13000, 14000);
- g_assert (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
{
GSList *cands = NULL, *i;
@@ -391,8 +391,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
global_ragent_gathering_done != TRUE) {
g_debug ("test-drop-invalid: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
set_credentials (lagent, ls_id, ragent, rs_id);
@@ -410,8 +410,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
g_main_loop_run (global_mainloop);
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* note: Send a packet from another address */
/* These should also be ignored */
@@ -421,10 +421,10 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
NiceSocket *tmpsock;
GError *error = NULL;
- g_assert (nice_agent_get_selected_pair (lagent, ls_id, 1, &local_cand,
+ g_assert_true (nice_agent_get_selected_pair (lagent, ls_id, 1, &local_cand,
&remote_cand));
- g_assert (local_cand);
- g_assert (remote_cand);
+ g_assert_true (local_cand);
+ g_assert_true (remote_cand);
tmpsock = nice_udp_bsd_socket_new (NULL, &error);
g_assert_no_error (error);
@@ -436,7 +436,7 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
/* note: test payload send and receive */
global_ragent_read = 0;
ret = nice_agent_send (lagent, ls_id, 1, 16, "1234567812345678");
- g_assert (ret != -1);
+ g_assert_true (ret != -1);
g_debug ("Sent %d bytes", ret);
g_assert_cmpint (ret, ==, 16);
while (global_ragent_read != 16)
diff --git a/tests/test-fallback.c b/tests/test-fallback.c
index 581d92e..27068f6 100644
--- a/tests/test-fallback.c
+++ b/tests/test-fallback.c
@@ -202,7 +202,7 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
for (i = cands; i; i = i->next) {
NiceCandidate *cand = i->data;
if (cand) {
- g_assert (dstaddr);
+ g_assert_true (dstaddr);
*dstaddr = cand->addr;
break;
}
@@ -266,8 +266,8 @@ static int run_fallback_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress
global_ragent_gathering_done != TRUE) {
g_debug ("test-fallback: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
/* step: find out the local candidates of each agent */
@@ -303,10 +303,10 @@ static int run_fallback_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress
nice_agent_set_remote_candidates (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP, cands);
/* step: fall back to non-ICE mode on both sides */
- g_assert (nice_agent_set_selected_pair (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, "1", "1") == TRUE);
- g_assert (nice_agent_set_selected_pair (lagent, ls_id, NICE_COMPONENT_TYPE_RTCP, "1", "1") == TRUE);
- g_assert (nice_agent_set_selected_pair (ragent, rs_id, NICE_COMPONENT_TYPE_RTP, "1", "1") == TRUE);
- g_assert (nice_agent_set_selected_pair (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP, "1", "1") == TRUE);
+ g_assert_true (nice_agent_set_selected_pair (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, "1", "1") == TRUE);
+ g_assert_true (nice_agent_set_selected_pair (lagent, ls_id, NICE_COMPONENT_TYPE_RTCP, "1", "1") == TRUE);
+ g_assert_true (nice_agent_set_selected_pair (ragent, rs_id, NICE_COMPONENT_TYPE_RTP, "1", "1") == TRUE);
+ g_assert_true (nice_agent_set_selected_pair (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP, "1", "1") == TRUE);
g_debug ("test-fallback: Requested for fallback, running mainloop until component state change is completed...");
@@ -402,8 +402,8 @@ static int run_safe_fallback_test (NiceAgent *lagent, NiceAgent *ragent, NiceAdd
global_ragent_gathering_done != TRUE) {
g_debug ("test-fallback: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
/* step: find out the local candidates of each agent */
@@ -428,17 +428,17 @@ static int run_safe_fallback_test (NiceAgent *lagent, NiceAgent *ragent, NiceAdd
cdes->component_id = NICE_COMPONENT_TYPE_RTP;
cdes->addr = raddr;
- g_assert (nice_agent_set_selected_remote_candidate (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, cdes));
+ g_assert_true (nice_agent_set_selected_remote_candidate (lagent, ls_id, NICE_COMPONENT_TYPE_RTP, cdes));
cdes->addr = laddr;
- g_assert (nice_agent_set_selected_remote_candidate (ragent, rs_id, NICE_COMPONENT_TYPE_RTP, cdes));
+ g_assert_true (nice_agent_set_selected_remote_candidate (ragent, rs_id, NICE_COMPONENT_TYPE_RTP, cdes));
cdes->component_id = NICE_COMPONENT_TYPE_RTCP;
cdes->addr = raddr_rtcp;
- g_assert (nice_agent_set_selected_remote_candidate (lagent, ls_id, NICE_COMPONENT_TYPE_RTCP, cdes));
+ g_assert_true (nice_agent_set_selected_remote_candidate (lagent, ls_id, NICE_COMPONENT_TYPE_RTCP, cdes));
cdes->addr = laddr_rtcp;
- g_assert (nice_agent_set_selected_remote_candidate (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP, cdes));
+ g_assert_true (nice_agent_set_selected_remote_candidate (ragent, rs_id, NICE_COMPONENT_TYPE_RTCP, cdes));
g_debug ("test-fallback: Requested for fallback, running mainloop until component state change is completed...");
diff --git a/tests/test-fullmode.c b/tests/test-fullmode.c
index 4bcec49..97f2521 100644
--- a/tests/test-fullmode.c
+++ b/tests/test-fullmode.c
@@ -352,14 +352,14 @@ get_port (NiceAgent *agent, guint stream_id, guint component_id)
GSList *item;
guint16 port = 0;
- g_assert (cands != NULL);
+ g_assert_true (cands != NULL);
for (item = cands; item; item = item->next) {
NiceCandidate *cand = item->data;
port = nice_address_get_port (&cand->addr);
break;
}
- g_assert (port != 0);
+ g_assert_true (port != 0);
g_slist_free_full (cands, (GDestroyNotify) nice_candidate_free);
@@ -419,12 +419,12 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
nice_agent_set_port_range (ragent, rs_id, 2, port, port);
- 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);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == FALSE);
+ g_assert_true (nice_agent_get_local_candidates (ragent, rs_id, 1) == NULL);
+ g_assert_true (nice_agent_get_local_candidates (ragent, rs_id, 2) == NULL);
nice_agent_set_port_range (ragent, rs_id, 2, 0, 0);
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
#if USE_LOOPBACK
{
@@ -486,8 +486,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
global_ragent_gathering_done != TRUE) {
g_debug ("test-fullmode: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
set_credentials (lagent, ls_id, ragent, rs_id);
@@ -505,8 +505,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
g_main_loop_run (global_mainloop);
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* note: test payload send and receive */
global_ragent_read = 0;
@@ -609,8 +609,8 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N
global_ragent_gathering_done != TRUE) {
g_debug ("test-fullmode: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
set_credentials (lagent, ls_id, ragent, rs_id);
@@ -628,7 +628,7 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N
global_exit_when_ibr_received = 0;
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
g_debug ("test-fullmode: Delayed answer received, continuing processing..");
@@ -639,7 +639,7 @@ static int run_full_test_delayed_answer (NiceAgent *lagent, NiceAgent *ragent, N
g_debug ("test-fullmode: Running mainloop until connectivity checks succeeed.");
g_main_loop_run (global_mainloop);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
g_assert_cmpuint (global_components_failed, ==, 0);
/* note: test payload send and receive */
@@ -730,8 +730,8 @@ static int run_full_test_wrong_password (NiceAgent *lagent, NiceAgent *ragent, N
global_ragent_gathering_done != TRUE) {
g_debug ("test-fullmode: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
g_debug ("test-fullmode: Got local candidates...");
@@ -817,8 +817,8 @@ static int run_full_test_control_conflict (NiceAgent *lagent, NiceAgent *ragent,
global_ragent_gathering_done != TRUE) {
g_debug ("test-fullmode: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
g_debug ("test-fullmode: Got local candidates...");
@@ -965,17 +965,17 @@ int main (void)
guint port = 0;
gboolean mode = FALSE;
g_object_get (G_OBJECT (lagent), "stun-server", &string, NULL);
- g_assert (stun_server == NULL || strcmp (string, stun_server) == 0);
+ g_assert_true (stun_server == NULL || strcmp (string, stun_server) == 0);
g_free (string);
g_object_get (G_OBJECT (lagent), "stun-server-port", &port, NULL);
- g_assert (stun_server_port == NULL || port == (guint)atoi (stun_server_port));
+ g_assert_true (stun_server_port == NULL || port == (guint)atoi (stun_server_port));
g_object_get (G_OBJECT (lagent), "proxy-ip", &string, NULL);
g_assert_cmpstr (string, ==, PROXY_IP);
g_free (string);
g_object_get (G_OBJECT (lagent), "proxy-port", &port, NULL);
g_assert_cmpuint (port, ==, PROXY_PORT);
g_object_get (G_OBJECT (lagent), "controlling-mode", &mode, NULL);
- g_assert (mode == TRUE);
+ g_assert_true (mode == TRUE);
g_object_set (G_OBJECT (lagent), "max-connectivity-checks", 300, NULL);
g_object_get (G_OBJECT (lagent), "max-connectivity-checks", &max_checks, NULL);
g_assert_cmpuint (max_checks, ==, 300);
@@ -1067,9 +1067,9 @@ int main (void)
priv_print_global_status ();
g_assert_cmpint (result, ==, 0);
/* should FAIL as agent L can't send any checks: */
- g_assert (global_lagent_state[0] == NICE_COMPONENT_STATE_FAILED ||
+ g_assert_true (global_lagent_state[0] == NICE_COMPONENT_STATE_FAILED ||
global_lagent_state[1] == NICE_COMPONENT_STATE_FAILED);
- g_assert (global_lagent_state[0] == NICE_COMPONENT_STATE_FAILED ||
+ g_assert_true (global_lagent_state[0] == NICE_COMPONENT_STATE_FAILED ||
global_lagent_state[1] == NICE_COMPONENT_STATE_FAILED);
#endif
@@ -1079,13 +1079,13 @@ int main (void)
priv_print_global_status ();
/* should SUCCEED as agent L can send the checks: */
g_assert_cmpint (result, ==, 0);
- g_assert (global_lagent_state[0] == NICE_COMPONENT_STATE_CONNECTED ||
+ g_assert_true (global_lagent_state[0] == NICE_COMPONENT_STATE_CONNECTED ||
global_lagent_state[0] == NICE_COMPONENT_STATE_READY);
- g_assert (global_lagent_state[1] == NICE_COMPONENT_STATE_CONNECTED ||
+ g_assert_true (global_lagent_state[1] == NICE_COMPONENT_STATE_CONNECTED ||
global_lagent_state[1] == NICE_COMPONENT_STATE_READY);
- g_assert (global_ragent_state[0] == NICE_COMPONENT_STATE_CONNECTED ||
+ g_assert_true (global_ragent_state[0] == NICE_COMPONENT_STATE_CONNECTED ||
global_ragent_state[0] == NICE_COMPONENT_STATE_READY);
- g_assert(global_ragent_state[1] == NICE_COMPONENT_STATE_CONNECTED ||
+ g_assert_true (global_ragent_state[1] == NICE_COMPONENT_STATE_CONNECTED ||
global_ragent_state[1] == NICE_COMPONENT_STATE_READY);
g_object_set (G_OBJECT (lagent), "max-connectivity-checks", 100, NULL);
diff --git a/tests/test-icetcp.c b/tests/test-icetcp.c
index 25f4043..6609893 100644
--- a/tests/test-icetcp.c
+++ b/tests/test-icetcp.c
@@ -297,8 +297,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
g_assert_cmpuint (rs_id, >, 0);
/* Gather candidates */
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
{
GSList *cands = NULL, *i;
@@ -308,11 +308,11 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
g_assert_cmpuint (g_slist_length (cands), ==, 2);
cand = cands->data;
g_assert_cmpint (cand->type, ==, NICE_CANDIDATE_TYPE_HOST);
- g_assert (cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE ||
+ g_assert_true (cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE ||
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE);
cand = cands->next->data;
g_assert_cmpint (cand->type, ==, NICE_CANDIDATE_TYPE_HOST);
- g_assert (cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE ||
+ g_assert_true (cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE ||
cand->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE);
for (i = cands; i; i = i->next)
nice_candidate_free ((NiceCandidate *) i->data);
@@ -339,8 +339,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
global_ragent_gathering_done != TRUE) {
g_debug ("test-icetcp: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
set_credentials (lagent, ls_id, ragent, rs_id);
@@ -358,8 +358,8 @@ static int run_full_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *bas
g_main_loop_run (global_mainloop);
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* note: test payload send and receive */
global_ragent_read = 0;
diff --git a/tests/test-interfaces.c b/tests/test-interfaces.c
index dba3b68..b1a510c 100644
--- a/tests/test-interfaces.c
+++ b/tests/test-interfaces.c
@@ -50,24 +50,24 @@ test_ipv4 (void)
/* test private addresses */
nice_address_set_from_string (&addr, "10.1.2.3");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr));
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr));
nice_address_set_from_string (&addr, "172.22.22.22");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr));
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr));
nice_address_set_from_string (&addr, "192.168.122.1");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr));
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr));
nice_address_set_from_string (&addr, "169.254.1.2");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr));
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr));
/* test public addresses */
nice_address_set_from_string (&addr, "1.2.3.4");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr) == FALSE);
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr) == FALSE);
}
@@ -85,13 +85,13 @@ test_ipv6 (void)
nice_address_set_from_string (&addr,
"fe8f:2233:4455:6677:8899:aabb:ccdd:eeff");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr));
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr));
/* test public addresses */
nice_address_set_from_string (&addr,
"11:2233:4455:6677:8899:aabb:ccdd:eeff");
nice_address_copy_to_sockaddr (&addr, &sin.addr);
- g_assert (nice_interfaces_is_private_ip (&sin.addr) == FALSE);
+ g_assert_true (nice_interfaces_is_private_ip (&sin.addr) == FALSE);
}
#endif /* G_OS_UNIX */
diff --git a/tests/test-io-stream-common.c b/tests/test-io-stream-common.c
index 35f0849..97f80b8 100644
--- a/tests/test-io-stream-common.c
+++ b/tests/test-io-stream-common.c
@@ -61,7 +61,7 @@ gboolean started;
g_main_context_iteration (context, FALSE); \
} \
\
- g_assert (!(var)); \
+ g_assert_true (!(var)); \
}
static gboolean timer_cb (gpointer pointer)
@@ -177,7 +177,7 @@ candidate_gathering_done_cb (NiceAgent *agent, guint stream_id,
g_free (password);
cands = nice_agent_get_local_candidates (agent, id, 1);
- g_assert (cands != NULL);
+ g_assert_true (cands != NULL);
nice_agent_set_remote_candidates (other, other_id, 1, cands);
@@ -192,7 +192,7 @@ reliable_transport_writable_cb (NiceAgent *agent, guint stream_id,
{
TestIOStreamThreadData *data = user_data;
- g_assert (data->reliable);
+ g_assert_true (data->reliable);
/* Signal writeability. */
g_mutex_lock (&data->write_mutex);
@@ -205,7 +205,7 @@ reliable_transport_writable_cb (NiceAgent *agent, guint stream_id,
GOutputStream *output_stream;
io_stream = g_object_get_data (G_OBJECT (agent), "io-stream");
- g_assert (io_stream != NULL);
+ g_assert_true (io_stream != NULL);
output_stream = g_io_stream_get_output_stream (io_stream);
data->callbacks->reliable_transport_writable (output_stream, agent,
@@ -265,7 +265,7 @@ create_agent (gboolean controlling_mode, TestIOStreamThreadData *data,
NULL);
/* Specify which local interface to use. */
- g_assert (nice_address_set_from_string (&base_addr, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&base_addr, "127.0.0.1"));
nice_agent_add_local_address (agent, &base_addr);
/* Hook up signals. */
@@ -337,7 +337,7 @@ spawn_thread (const gchar *thread_name, GThreadFunc thread_func,
GThread *thread;
thread = g_thread_new (thread_name, thread_func, user_data);
- g_assert (thread);
+ g_assert_true (thread);
return thread;
}
diff --git a/tests/test-new-trickle.c b/tests/test-new-trickle.c
index ac3c026..94e5f9c 100644
--- a/tests/test-new-trickle.c
+++ b/tests/test-new-trickle.c
@@ -94,7 +94,7 @@ static const uint16_t known_attributes[] = {
g_main_context_iteration (context, FALSE); \
} \
\
- g_assert (!(var)); \
+ g_assert_true (!(var)); \
}
/*
@@ -131,7 +131,7 @@ static int listen_socket (unsigned int *port)
g_assert_cmpint (socklen, ==, sizeof(struct sockaddr_in));
*port = ntohs (addr.in.sin_port);
- g_assert (*port != 0);
+ g_assert_true (*port != 0);
}
return fd;
@@ -227,7 +227,7 @@ recv_packet:
send_buf:
g_cancellable_cancel (global_cancellable);
g_debug ("Ready to send a STUN response");
- g_assert (g_mutex_trylock (stun_mutex_ptr));
+ g_assert_true (g_mutex_trylock (stun_mutex_ptr));
got_stun_packet = TRUE;
while (send_stun) {
g_debug ("Waiting for signal. State is %d", global_lagent_state);
@@ -352,7 +352,7 @@ static void swap_candidates(NiceAgent *local, guint local_id, NiceAgent *remote,
g_debug ("test-tricklemode:%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,
+ g_assert_true (nice_agent_set_remote_candidates(remote, remote_id,
NICE_COMPONENT_TYPE_RTP, cands));
if (signal_stun_reply) {
@@ -386,7 +386,7 @@ static void cb_agent_new_candidate(NiceAgent *agent, guint stream_id, guint comp
if (g_strcmp0(temp->foundation, foundation) == 0) {
g_debug ("Adding new local candidate to other agent's connchecks");
remote_cands = g_slist_prepend (remote_cands, nice_candidate_copy(temp));
- g_assert (nice_agent_set_remote_candidates (other, id,
+ g_assert_true (nice_agent_set_remote_candidates (other, id,
NICE_COMPONENT_TYPE_RTP,
remote_cands));
}
@@ -402,7 +402,7 @@ static void add_bad_candidate (NiceAgent *agent, guint stream_id, NiceCandidate
NiceAddress bad_addr;
GSList *cand_list = NULL;
- g_assert (nice_address_set_from_string (&bad_addr, "172.1.0.1"));
+ g_assert_true (nice_address_set_from_string (&bad_addr, "172.1.0.1"));
cand = nice_candidate_new (NICE_CANDIDATE_TYPE_HOST);
cand->stream_id = stream_id;
@@ -414,7 +414,7 @@ static void add_bad_candidate (NiceAgent *agent, guint stream_id, NiceCandidate
cand_list = g_slist_prepend (cand_list, cand);
g_debug ("Adding buggy candidate to the agent %p", agent);
- g_assert (nice_agent_set_remote_candidates (agent, stream_id,
+ g_assert_true (nice_agent_set_remote_candidates (agent, stream_id,
NICE_COMPONENT_TYPE_RTP,
cand_list));
@@ -485,15 +485,15 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
nice_agent_gather_candidates (lagent, global_ls_id);
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
- g_assert (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
+ g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (ragent_candidate_gathering_done);
- g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
+ g_assert_true (ragent_candidate_gathering_done);
+ g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
g_debug ("Setting local candidates of ragent as remote candidates of lagent");
@@ -503,7 +503,7 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
while (!data_received)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (global_lagent_state >= NICE_COMPONENT_STATE_CONNECTED &&
+ g_assert_true (global_lagent_state >= NICE_COMPONENT_STATE_CONNECTED &&
data_received);
g_debug ("Setting local candidates of lagent as remote candidates of ragent");
@@ -514,8 +514,8 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (lagent_candidate_gathering_done);
- g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
+ g_assert_true (lagent_candidate_gathering_done);
+ g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
while (global_ragent_state < NICE_COMPONENT_STATE_CONNECTED)
g_main_context_iteration (NULL, TRUE);
@@ -542,15 +542,15 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
+ g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (ragent_candidate_gathering_done);
- g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
+ g_assert_true (ragent_candidate_gathering_done);
+ g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
g_debug ("Setting local candidates of ragent as remote candidates of lagent");
swap_candidates (ragent, global_rs_id, lagent, global_ls_id, FALSE);
@@ -572,7 +572,7 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (data_received);
+ g_assert_true (data_received);
g_assert_cmpint (global_lagent_state, ==, NICE_COMPONENT_STATE_READY);
g_assert_cmpint (global_ragent_state, >=, NICE_COMPONENT_STATE_CONNECTED);
@@ -581,8 +581,8 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (lagent_candidate_gathering_done);
- g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
+ g_assert_true (lagent_candidate_gathering_done);
+ g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
cleanup (lagent, ragent);
}
@@ -599,7 +599,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
+ g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
@@ -607,8 +607,8 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (ragent_candidate_gathering_done);
- g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
+ g_assert_true (ragent_candidate_gathering_done);
+ g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
add_bad_candidate (lagent, global_ls_id, cand);
@@ -617,14 +617,14 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
+ g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
// connchecks will fail causing this mainloop to quit
while (global_lagent_state != NICE_COMPONENT_STATE_FAILED)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (global_lagent_state == NICE_COMPONENT_STATE_FAILED &&
+ g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_FAILED &&
!data_received);
g_debug ("Setting local candidates of ragent as remote candidates of lagent");
@@ -639,7 +639,7 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (lagent_candidate_gathering_done);
+ g_assert_true (lagent_candidate_gathering_done);
g_assert_cmpint (global_lagent_state, >=, NICE_COMPONENT_STATE_CONNECTED);
g_assert_cmpint (global_ragent_state, >=, NICE_COMPONENT_STATE_CONNECTING);
@@ -659,20 +659,20 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
+ g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
+ g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
// Wait for data
while (!data_received)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (data_received);
+ g_assert_true (data_received);
// Data arrived, signal STUN thread to send STUN response
g_mutex_lock (stun_mutex_ptr);
@@ -684,10 +684,10 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
while (!lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
g_cancellable_reset (global_cancellable);
- g_assert (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
+ g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
- g_assert (lagent_candidate_gathering_done);
- g_assert (ragent_candidate_gathering_done);
+ g_assert_true (lagent_candidate_gathering_done);
+ g_assert_true (ragent_candidate_gathering_done);
g_assert_cmpint (global_lagent_state, ==, NICE_COMPONENT_STATE_READY);
g_assert_cmpint (global_ragent_state, >=, NICE_COMPONENT_STATE_CONNECTED);
@@ -762,7 +762,7 @@ int main(void)
g_object_set_data (G_OBJECT (lagent), "other-agent", ragent);
g_object_set_data (G_OBJECT (ragent), "other-agent", lagent);
- g_assert (nice_address_set_from_string (&baseaddr, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&baseaddr, "127.0.0.1"));
nice_agent_add_local_address (lagent, &baseaddr);
nice_agent_add_local_address (ragent, &baseaddr);
diff --git a/tests/test-nomination.c b/tests/test-nomination.c
index 44764e3..72a95a7 100644
--- a/tests/test-nomination.c
+++ b/tests/test-nomination.c
@@ -77,7 +77,7 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
global_components_ready++;
else if (state == NICE_COMPONENT_STATE_CONNECTED && ready_to_connected)
global_components_ready--;
- g_assert (state != NICE_COMPONENT_STATE_FAILED);
+ g_assert_true (state != NICE_COMPONENT_STATE_FAILED);
g_debug ("test-nomination: checks READY %u.", global_components_ready);
}
@@ -186,8 +186,8 @@ run_test(NiceNominationMode l_nomination_mode,
g_assert_cmpuint (rs_id, >, 0);
/* Gather candidates and test nice_agent_set_port_range */
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
nice_agent_attach_recv (lagent, ls_id, NICE_COMPONENT_TYPE_RTP,
g_main_context_default (), cb_nice_recv, GUINT_TO_POINTER (1));
@@ -197,10 +197,10 @@ run_test(NiceNominationMode l_nomination_mode,
g_debug ("test-nomination: Added streams, running context until 'candidate-gathering-done'...");
while (!global_lagent_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_assert (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_lagent_gathering_done == TRUE);
while (!global_ragent_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_assert (global_ragent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
set_credentials (lagent, ls_id, ragent, rs_id);
diff --git a/tests/test-pseudotcp-fin.c b/tests/test-pseudotcp-fin.c
index 743505d..d007513 100644
--- a/tests/test-pseudotcp-fin.c
+++ b/tests/test-pseudotcp-fin.c
@@ -245,7 +245,7 @@ expect_segment (PseudoTcpSocket *socket, GQueue/*<owned GBytes>*/ *queue,
/* Grab the segment. */
bytes = g_queue_peek_head (queue);
- g_assert (bytes != NULL);
+ g_assert_true (bytes != NULL);
b.u8 = g_bytes_get_data (bytes, &size);
g_assert_cmpuint (size, >=, 24); /* minimum packet size */
@@ -286,7 +286,7 @@ forward_segment (GQueue/*<owned GBytes>*/ *from, PseudoTcpSocket *to)
gboolean retval;
segment = g_queue_pop_head (from);
- g_assert (segment != NULL);
+ g_assert_true (segment != NULL);
b = g_bytes_get_data (segment, &size);
retval = pseudo_tcp_socket_notify_packet (to, (const gchar *) b, size);
g_bytes_unref (segment);
@@ -297,13 +297,13 @@ forward_segment (GQueue/*<owned GBytes>*/ *from, PseudoTcpSocket *to)
static void
forward_segment_ltr (Data *data)
{
- g_assert (forward_segment (data->left_sent, data->right));
+ g_assert_true (forward_segment (data->left_sent, data->right));
}
static void
forward_segment_rtl (Data *data)
{
- g_assert (forward_segment (data->right_sent, data->left));
+ g_assert_true (forward_segment (data->right_sent, data->left));
}
static void
@@ -312,7 +312,7 @@ duplicate_segment (GQueue/*<owned GBytes>*/ *queue)
GBytes *segment; /* unowned */
segment = g_queue_peek_head (queue);
- g_assert (segment != NULL);
+ g_assert_true (segment != NULL);
g_queue_push_head (queue, g_bytes_ref (segment));
}
@@ -323,7 +323,7 @@ drop_segment (PseudoTcpSocket *socket, GQueue/*<owned GBytes>*/ *queue)
gchar *str;
segment = g_queue_pop_head (queue);
- g_assert (segment != NULL);
+ g_assert_true (segment != NULL);
str = segment_bytes_to_string (g_bytes_get_data (segment, NULL));
g_debug ("%p drop: %s", socket, str);
@@ -340,9 +340,9 @@ reorder_segments (PseudoTcpSocket *socket, GQueue/*<owned GBytes>*/ *queue)
gchar *str;
segment1 = g_queue_pop_head (queue);
- g_assert (segment1 != NULL);
+ g_assert_true (segment1 != NULL);
segment2 = g_queue_pop_head (queue);
- g_assert (segment2 != NULL);
+ g_assert_true (segment2 != NULL);
str = segment_bytes_to_string (g_bytes_get_data (segment1, NULL));
g_debug ("%p reorder: %s", socket, str);
@@ -969,9 +969,9 @@ pseudotcp_close_duplicate_ack (void)
expect_ack (data.left, data.left_sent, 8, 8);
duplicate_segment (data.left_sent);
forward_segment_ltr (&data);
- g_assert (!forward_segment (data.left_sent, data.right));
+ g_assert_true (!forward_segment (data.left_sent, data.right));
expect_rst (data.right, data.right_sent, 8, 8);
- g_assert (!forward_segment (data.right_sent, data.left));
+ g_assert_true (!forward_segment (data.right_sent, data.left));
expect_sockets_closed (&data);
@@ -997,7 +997,7 @@ pseudotcp_close_rst (void)
g_assert_cmpint (pseudo_tcp_socket_recv (data.left, (char *) buf, sizeof (buf)), ==, 0);
expect_rst (data.left, data.left_sent, 7, 7);
- g_assert (!forward_segment (data.left_sent, data.right));
+ g_assert_true (!forward_segment (data.left_sent, data.right));
/* Check the RHS is closed. */
g_assert_cmpint (pseudo_tcp_socket_send (data.right, "foo", 3), ==, -1);
@@ -1031,7 +1031,7 @@ pseudotcp_close_pending_received (void)
close_socket (data.left);
expect_rst (data.left, data.left_sent, 7, 10);
- g_assert (!forward_segment (data.left_sent, data.right));
+ g_assert_true (!forward_segment (data.left_sent, data.right));
/* Check the RHS is closed. */
g_assert_cmpint (pseudo_tcp_socket_send (data.right, "foo", 3), ==, -1);
@@ -1067,10 +1067,10 @@ pseudotcp_close_rst_afterwards (void)
/* Send some data from RHS to LHS, which should result in an RST. */
g_assert_cmpint (pseudo_tcp_socket_send (data.right, "foo", 3), ==, 3);
expect_data (data.right, data.right_sent, 7, 7, 3);
- g_assert (!forward_segment (data.right_sent, data.left));
+ g_assert_true (!forward_segment (data.right_sent, data.left));
expect_rst (data.left, data.left_sent, 7, 7);
- g_assert (!forward_segment (data.left_sent, data.right));
+ g_assert_true (!forward_segment (data.left_sent, data.right));
/* Check the RHS is closed. */
g_assert_cmpint (pseudo_tcp_socket_send (data.right, "foo", 3), ==, -1);
@@ -1107,7 +1107,7 @@ pseudotcp_compatibility (void)
/* Close it. Sending shouldn’t fail. */
pseudo_tcp_socket_close (data.left, FALSE);
- g_assert (!pseudo_tcp_socket_is_closed (data.left));
+ g_assert_true (!pseudo_tcp_socket_is_closed (data.left));
g_assert_cmpint (pseudo_tcp_socket_send (data.left, "foo", 3), ==, 3);
g_assert_cmpint (pseudo_tcp_socket_recv (data.left, (char *) buf, sizeof (buf)), ==, -1);
@@ -1125,7 +1125,7 @@ pseudotcp_compatibility (void)
* outstanding data. */
increment_time_both (&data, 50);
- g_assert (!pseudo_tcp_socket_get_next_clock (data.left, &timeout));
+ g_assert_true (!pseudo_tcp_socket_get_next_clock (data.left, &timeout));
/* Check the RHS can be closed after receiving the data just sent. */
g_assert_cmpint (pseudo_tcp_socket_recv (data.right, (char *) buf, sizeof (buf)), ==, 3);
@@ -1134,7 +1134,7 @@ pseudotcp_compatibility (void)
pseudo_tcp_socket_close (data.right, FALSE);
- g_assert (!pseudo_tcp_socket_get_next_clock (data.right, &timeout));
+ g_assert_true (!pseudo_tcp_socket_get_next_clock (data.right, &timeout));
expect_sockets_closed (&data);
diff --git a/tests/test-pseudotcp-fuzzy.c b/tests/test-pseudotcp-fuzzy.c
index 3c41a9b..5e0d443 100644
--- a/tests/test-pseudotcp-fuzzy.c
+++ b/tests/test-pseudotcp-fuzzy.c
@@ -119,7 +119,7 @@ write_to_sock (PseudoTcpSocket *sock)
len = fread (buf, 1, sizeof(buf), in);
if (len == 0) {
g_debug ("Done reading data from file");
- g_assert (feof (in));
+ g_assert_true (feof (in));
reading_done = TRUE;
pseudo_tcp_socket_close (sock, FALSE);
break;
@@ -131,7 +131,7 @@ write_to_sock (PseudoTcpSocket *sock)
if (wlen < (gint) len) {
g_debug ("seeking %" G_GSIZE_FORMAT " from %lu", wlen - len, ftell (in));
fseek (in, wlen - len, SEEK_CUR);
- g_assert (!feof (in));
+ g_assert_true (!feof (in));
g_debug ("Socket queue full after %d bytes written", total);
break;
}
@@ -176,7 +176,7 @@ readable (PseudoTcpSocket *sock, gpointer data)
g_assert_cmpint (total_wrote, <=, total_read);
g_debug ("Written %d bytes, need %d bytes", total_wrote, total_read);
if (total_wrote == total_read && feof (in)) {
- g_assert (reading_done);
+ g_assert_true (reading_done);
pseudo_tcp_socket_close (sock, FALSE);
}
}
diff --git a/tests/test-pseudotcp.c b/tests/test-pseudotcp.c
index e975dd9..0a5f1d1 100644
--- a/tests/test-pseudotcp.c
+++ b/tests/test-pseudotcp.c
@@ -71,7 +71,7 @@ static void write_to_sock (PseudoTcpSocket *sock)
len = fread (buf, 1, sizeof(buf), in);
if (len == 0) {
g_debug ("Done reading data from file");
- g_assert (feof (in));
+ g_assert_true (feof (in));
reading_done = TRUE;
pseudo_tcp_socket_close (sock, FALSE);
break;
@@ -84,7 +84,7 @@ static void write_to_sock (PseudoTcpSocket *sock)
g_debug ("seeking %" G_GSIZE_FORMAT " from %lu", wlen - len,
ftell (in));
fseek (in, wlen - len, SEEK_CUR);
- g_assert (!feof (in));
+ g_assert_true (!feof (in));
g_debug ("Socket queue full after %d bytes written", total);
break;
}
@@ -127,7 +127,7 @@ static void readable (PseudoTcpSocket *sock, gpointer data)
g_assert_cmpint (total_wrote, <=, total_read);
g_debug ("Written %d bytes, need %d bytes", total_wrote, total_read);
if (total_wrote == total_read && feof (in)) {
- g_assert (reading_done);
+ g_assert_true (reading_done);
pseudo_tcp_socket_close (sock, FALSE);
}
}
diff --git a/tests/test-restart.c b/tests/test-restart.c
index 18bf8d2..ab0bdea 100644
--- a/tests/test-restart.c
+++ b/tests/test-restart.c
@@ -187,7 +187,7 @@ static void priv_get_local_addr (NiceAgent *agent, guint stream_id, guint compon
for (i = cands; i; i = i->next) {
NiceCandidate *cand = i->data;
if (cand) {
- g_assert (dstaddr);
+ g_assert_true (dstaddr);
*dstaddr = cand->addr;
}
}
@@ -252,8 +252,8 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
global_ragent_gathering_done != TRUE) {
g_debug ("test-restart: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
/* step: find out the local candidates of each agent */
@@ -303,7 +303,7 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
* here that the role cannot be externally modified after conncheck
* has started. */
g_object_set (G_OBJECT (ragent), "controlling-mode", TRUE, NULL);
- g_assert (ragent->controlling_mode == FALSE);
+ g_assert_true (ragent->controlling_mode == FALSE);
g_debug ("test-restart: Set properties, next running mainloop until connectivity checks succeed...");
@@ -312,8 +312,8 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
g_main_loop_run (global_mainloop);
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* note: verify that correct number of local candidates were reported */
g_assert_cmpint (global_lagent_cands, ==, 2);
g_assert_cmpint (global_ragent_cands, ==, 2);
@@ -333,8 +333,8 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
g_assert_cmpint (nice_agent_send (lagent, ls_id, 1, 16, "1234567812345678"), ==, 16);
/* Both agent have a distinct role at the end of the conncheck */
- g_assert (lagent->controlling_mode == TRUE);
- g_assert (ragent->controlling_mode == FALSE);
+ g_assert_true (lagent->controlling_mode == TRUE);
+ g_assert_true (ragent->controlling_mode == FALSE);
/* step: restart agents, exchange updated credentials */
nice_agent_restart (ragent);
nice_agent_restart (lagent);
@@ -377,10 +377,10 @@ static int run_restart_test (NiceAgent *lagent, NiceAgent *ragent, NiceAddress *
/* note: verify that payload was succesfully received */
g_assert_cmpint (global_ragent_read, ==, 32);
/* note: verify binding requests were resent after restart */
- g_assert (global_lagent_ibr_received == TRUE);
- g_assert (global_ragent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_ragent_ibr_received == TRUE);
/* note: verify that a role switch occured for one of the agents */
- g_assert (ragent->controlling_mode != lagent->controlling_mode);
+ g_assert_true (ragent->controlling_mode != lagent->controlling_mode);
g_debug ("test-restart: Ran mainloop, removing streams...");
diff --git a/tests/test-send-recv.c b/tests/test-send-recv.c
index f696a9c..6031ea5 100644
--- a/tests/test-send-recv.c
+++ b/tests/test-send-recv.c
@@ -501,7 +501,7 @@ validate_received_messages (TestIOStreamThreadData *data, gsize buffer_offset,
if (stream_api_is_blocking (test_data->stream_api) && data->reliable)
g_assert_cmpuint (message->length, ==, total_buf_len);
- g_assert (message->from == NULL);
+ g_assert_true (message->from == NULL);
}
/* Free all messages. */
diff --git a/tests/test-set-port-range.c b/tests/test-set-port-range.c
index 1ed1b4d..c7bf2ec 100644
--- a/tests/test-set-port-range.c
+++ b/tests/test-set-port-range.c
@@ -56,14 +56,14 @@ int main (int argc, char **argv)
nice_agent_set_port_range (agent, stream1, 2, 8888, 8888);
/* First test with ICE-TCP enabled, this should fail on creating the port */
- g_assert (nice_agent_gather_candidates (agent, stream1) == FALSE);
+ g_assert_true (nice_agent_gather_candidates (agent, stream1) == FALSE);
/* First test with ICE-TCP disabled, this should fail on our explicit test */
g_object_set (agent, "ice-tcp", FALSE, NULL);
- g_assert (nice_agent_gather_candidates (agent, stream1) == FALSE);
+ g_assert_true (nice_agent_gather_candidates (agent, stream1) == FALSE);
nice_agent_set_port_range (agent, stream1, 2, 9999, 9999);
- g_assert (nice_agent_gather_candidates (agent, stream1));
+ g_assert_true (nice_agent_gather_candidates (agent, stream1));
g_object_unref (agent);
diff --git a/tests/test-socket-is-based-on.c b/tests/test-socket-is-based-on.c
index 17ca5fd..8ed2cbb 100644
--- a/tests/test-socket-is-based-on.c
+++ b/tests/test-socket-is-based-on.c
@@ -45,37 +45,37 @@ static NiceSocket *udp_turn_over_tcp;
static void
socket_base_udp_bsd (void)
{
- g_assert (nice_socket_is_based_on (udp_bsd, udp_bsd));
- g_assert (!nice_socket_is_based_on (udp_bsd, tcp_active));
- g_assert (!nice_socket_is_based_on (udp_bsd, pseudossl));
- g_assert (!nice_socket_is_based_on (udp_bsd, udp_turn_over_tcp));
+ g_assert_true (nice_socket_is_based_on (udp_bsd, udp_bsd));
+ g_assert_true (!nice_socket_is_based_on (udp_bsd, tcp_active));
+ g_assert_true (!nice_socket_is_based_on (udp_bsd, pseudossl));
+ g_assert_true (!nice_socket_is_based_on (udp_bsd, udp_turn_over_tcp));
}
static void
socket_base_tcp_active (void)
{
- g_assert (!nice_socket_is_based_on (tcp_active, udp_bsd));
- g_assert (nice_socket_is_based_on (tcp_active, tcp_active));
- g_assert (!nice_socket_is_based_on (tcp_active, pseudossl));
- g_assert (!nice_socket_is_based_on (tcp_active, udp_turn_over_tcp));
+ g_assert_true (!nice_socket_is_based_on (tcp_active, udp_bsd));
+ g_assert_true (nice_socket_is_based_on (tcp_active, tcp_active));
+ g_assert_true (!nice_socket_is_based_on (tcp_active, pseudossl));
+ g_assert_true (!nice_socket_is_based_on (tcp_active, udp_turn_over_tcp));
}
static void
socket_base_pseudossl (void)
{
- g_assert (!nice_socket_is_based_on (pseudossl, udp_bsd));
- g_assert (nice_socket_is_based_on (pseudossl, tcp_active));
- g_assert (nice_socket_is_based_on (pseudossl, pseudossl));
- g_assert (!nice_socket_is_based_on (pseudossl, udp_turn_over_tcp));
+ g_assert_true (!nice_socket_is_based_on (pseudossl, udp_bsd));
+ g_assert_true (nice_socket_is_based_on (pseudossl, tcp_active));
+ g_assert_true (nice_socket_is_based_on (pseudossl, pseudossl));
+ g_assert_true (!nice_socket_is_based_on (pseudossl, udp_turn_over_tcp));
}
static void
socket_base_udp_turn_over_tcp (void)
{
- g_assert (!nice_socket_is_based_on (udp_turn_over_tcp, udp_bsd));
- g_assert (nice_socket_is_based_on (udp_turn_over_tcp, tcp_active));
- g_assert (nice_socket_is_based_on (udp_turn_over_tcp, pseudossl));
- g_assert (nice_socket_is_based_on (udp_turn_over_tcp, udp_turn_over_tcp));
+ g_assert_true (!nice_socket_is_based_on (udp_turn_over_tcp, udp_bsd));
+ g_assert_true (nice_socket_is_based_on (udp_turn_over_tcp, tcp_active));
+ g_assert_true (nice_socket_is_based_on (udp_turn_over_tcp, pseudossl));
+ g_assert_true (nice_socket_is_based_on (udp_turn_over_tcp, udp_turn_over_tcp));
}
int
diff --git a/tests/test-tcp.c b/tests/test-tcp.c
index 6abb92d..f94ac88 100644
--- a/tests/test-tcp.c
+++ b/tests/test-tcp.c
@@ -52,7 +52,7 @@ static gboolean
on_server_connection_available (gpointer user_data)
{
server = nice_tcp_passive_socket_accept (passive_sock);
- g_assert (server);
+ g_assert_true (server);
g_main_loop_quit (mainloop);
@@ -63,7 +63,7 @@ static gboolean
on_server_input_available (gpointer user_data)
{
g_assert_cmpint (5, ==, nice_socket_recv (server, &tmp, 5, buf));
- g_assert (nice_address_equal (&tmp, &client->addr));
+ g_assert_true (nice_address_equal (&tmp, &client->addr));
g_main_loop_quit (mainloop);
@@ -74,7 +74,7 @@ static gboolean
on_client_input_available (gpointer user_data)
{
g_assert_cmpint (5, ==, nice_socket_recv (client, &tmp, 5, buf));
- g_assert (nice_address_equal (&tmp, &server->addr));
+ g_assert_true (nice_address_equal (&tmp, &server->addr));
g_main_loop_quit (mainloop);
@@ -93,10 +93,10 @@ main (void)
mainloop = g_main_loop_new (NULL, FALSE);
nice_address_init (&active_bind_addr);
- g_assert (nice_address_set_from_string (&active_bind_addr, "::1"));
+ g_assert_true (nice_address_set_from_string (&active_bind_addr, "::1"));
nice_address_init (&passive_bind_addr);
- g_assert (nice_address_set_from_string (&passive_bind_addr, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&passive_bind_addr, "127.0.0.1"));
nice_address_set_port (&passive_bind_addr, 0);
nice_address_init (&tmp);
@@ -104,7 +104,7 @@ main (void)
passive_sock = nice_tcp_passive_socket_new (g_main_loop_get_context (mainloop),
&passive_bind_addr, &error);
g_assert_no_error (error);
- g_assert (passive_sock);
+ g_assert_true (passive_sock);
srv_listen_source = g_socket_create_source (passive_sock->fileno,
G_IO_IN, NULL);
@@ -114,15 +114,15 @@ main (void)
active_sock = nice_tcp_active_socket_new (g_main_loop_get_context (mainloop),
&active_bind_addr);
- g_assert (active_sock);
+ g_assert_true (active_sock);
client = nice_tcp_active_socket_connect (active_sock, &passive_sock->addr);
- g_assert (client);
+ g_assert_true (client);
nice_socket_free (active_sock);
active_sock = NULL;
g_main_loop_run (mainloop); /* -> on_server_connection_available */
- g_assert (server);
+ g_assert_true (server);
srv_input_source = g_socket_create_source (server->fileno, G_IO_IN, NULL);
g_source_set_callback (srv_input_source,
@@ -134,20 +134,20 @@ main (void)
on_client_input_available, NULL, NULL);
g_source_attach (cli_input_source, g_main_loop_get_context (mainloop));
- g_assert (nice_address_get_port (&client->addr) != 0);
+ g_assert_true (nice_address_get_port (&client->addr) != 0);
- g_assert (nice_address_set_from_string (&tmp, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&tmp, "127.0.0.1"));
nice_address_set_port (&tmp, nice_address_get_port (&server->addr));
- g_assert (nice_address_get_port (&tmp) != 0);
+ g_assert_true (nice_address_get_port (&tmp) != 0);
g_assert_cmpint (5, ==, nice_socket_send (client, &tmp, 5, "hello"));
g_main_loop_run (mainloop); /* -> on_server_input_available */
- g_assert (0 == strncmp (buf, "hello", 5));
+ g_assert_true (0 == strncmp (buf, "hello", 5));
g_assert_cmpint (5, ==, nice_socket_send (server, &tmp, 5, "uryyb"));
g_main_loop_run (mainloop); /* -> on_client_input_available */
- g_assert (0 == strncmp (buf, "uryyb", 5));
+ g_assert_true (0 == strncmp (buf, "uryyb", 5));
nice_socket_free (client);
nice_socket_free (server);
diff --git a/tests/test-thread.c b/tests/test-thread.c
index fe5f0f1..6ec4980 100644
--- a/tests/test-thread.c
+++ b/tests/test-thread.c
@@ -66,7 +66,7 @@ gint global_ragent_buffers = 0;
g_main_context_iteration (context, FALSE); \
} \
\
- g_assert (!(var)); \
+ g_assert_true (!(var)); \
}
static gpointer
@@ -119,7 +119,7 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
g_free (password);
cands = nice_agent_get_local_candidates(agent, id, 1);
- g_assert (cands != NULL);
+ g_assert_true (cands != NULL);
nice_agent_set_remote_candidates (other, other_id, 1, cands);
@@ -263,12 +263,12 @@ int main (void)
guint port = 0;
gboolean mode = FALSE;
g_object_get (G_OBJECT (lagent), "stun-server", &string, NULL);
- g_assert (stun_server == NULL || strcmp (string, stun_server) == 0);
+ g_assert_true (stun_server == NULL || strcmp (string, stun_server) == 0);
g_free (string);
g_object_get (G_OBJECT (lagent), "stun-server-port", &port, NULL);
- g_assert (stun_server_port == NULL || port == (guint)atoi (stun_server_port));
+ g_assert_true (stun_server_port == NULL || port == (guint)atoi (stun_server_port));
g_object_get (G_OBJECT (lagent), "controlling-mode", &mode, NULL);
- g_assert (mode == TRUE);
+ g_assert_true (mode == TRUE);
g_object_set (G_OBJECT (lagent), "max-connectivity-checks", 300, NULL);
g_object_get (G_OBJECT (lagent), "max-connectivity-checks", &max_checks, NULL);
g_assert_cmpuint (max_checks, ==, 300);
@@ -280,8 +280,8 @@ int main (void)
lthread = g_thread_new ("lthread libnice", mainloop_thread, lmainloop);
rthread = g_thread_new ("rthread libnice", mainloop_thread, rmainloop);
- g_assert (lthread);
- g_assert (rthread);
+ g_assert_true (lthread);
+ g_assert_true (rthread);
ls_id = nice_agent_add_stream (lagent, 2);
rs_id = nice_agent_add_stream (ragent, 2);
@@ -302,8 +302,8 @@ int main (void)
ldthread = g_thread_new ("ldthread libnice", mainloop_thread, ldmainloop);
rdthread = g_thread_new ("rdthread libnice", mainloop_thread, rdmainloop);
- g_assert (ldthread);
- g_assert (rdthread);
+ g_assert_true (ldthread);
+ g_assert_true (rdthread);
g_debug ("ragent_buffers: %d lagent_buffers: %d", global_lagent_buffers,
global_ragent_buffers);
diff --git a/tests/test-trickle.c b/tests/test-trickle.c
index cb386ac..d17fc52 100644
--- a/tests/test-trickle.c
+++ b/tests/test-trickle.c
@@ -311,8 +311,8 @@ int main (void)
global_ragent_gathering_done != TRUE) {
g_debug ("test-trickle: 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);
+ g_assert_true (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
}
{
@@ -349,7 +349,7 @@ int main (void)
g_main_loop_run (global_mainloop);
/* note: verify that STUN binding requests were sent */
- g_assert (global_lagent_ibr_received == TRUE);
+ g_assert_true (global_lagent_ibr_received == TRUE);
g_assert_cmpint (global_ragent_ibr_received, ==, TRUE);
g_assert_cmpint (global_lagent_state, ==, NICE_COMPONENT_STATE_READY);
diff --git a/tests/test-turn.c b/tests/test-turn.c
index e373790..62426d2 100644
--- a/tests/test-turn.c
+++ b/tests/test-turn.c
@@ -85,7 +85,7 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
global_components_ready++;
else if (state == NICE_COMPONENT_STATE_CONNECTED && ready_to_connected)
global_components_ready--;
- g_assert (state != NICE_COMPONENT_STATE_FAILED);
+ g_assert_true (state != NICE_COMPONENT_STATE_FAILED);
g_debug ("test-turn: checks READY %u.", global_components_ready);
}
@@ -222,13 +222,13 @@ run_test(guint turn_port, gboolean is_ipv6,
nice_agent_set_relay_info(ragent, rs_id, 1,
localhost, turn_port, TURN_USER, TURN_PASS, turn_type);
- g_assert (global_lagent_gathering_done == FALSE);
- g_assert (global_ragent_gathering_done == FALSE);
+ g_assert_true (global_lagent_gathering_done == FALSE);
+ g_assert_true (global_ragent_gathering_done == FALSE);
g_debug ("test-turn: Added streams, running context until 'candidate-gathering-done'...");
/* Gather candidates and test nice_agent_set_port_range */
- g_assert (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
- g_assert (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (lagent, ls_id) == TRUE);
+ g_assert_true (nice_agent_gather_candidates (ragent, rs_id) == TRUE);
nice_agent_attach_recv (lagent, ls_id, NICE_COMPONENT_TYPE_RTP,
g_main_context_default (), cb_nice_recv, GUINT_TO_POINTER (1));
@@ -237,10 +237,10 @@ run_test(guint turn_port, gboolean is_ipv6,
while (!global_lagent_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_assert (global_lagent_gathering_done == TRUE);
+ g_assert_true (global_lagent_gathering_done == TRUE);
while (!global_ragent_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_assert (global_ragent_gathering_done == TRUE);
+ g_assert_true (global_ragent_gathering_done == TRUE);
set_credentials (lagent, ls_id, ragent, rs_id);
diff --git a/tests/test.c b/tests/test.c
index b937c79..ff435dd 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -55,7 +55,7 @@
g_main_context_iteration (context, FALSE); \
} \
\
- g_assert (!(var)); \
+ g_assert_true (!(var)); \
}
gint
@@ -76,21 +76,21 @@ main (void)
nice_address_init (&addr_local);
nice_address_init (&addr_remote);
- g_assert (nice_address_set_from_string (&addr_local, "127.0.0.1"));
- g_assert (nice_address_set_from_string (&addr_remote, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&addr_local, "127.0.0.1"));
+ g_assert_true (nice_address_set_from_string (&addr_remote, "127.0.0.1"));
nice_address_set_port (&addr_remote, 2345);
agent = nice_agent_new ( NULL, NICE_COMPATIBILITY_RFC5245);
g_object_set (G_OBJECT (agent), "ice-tcp", FALSE, NULL);
- g_assert (agent->local_addresses == NULL);
+ g_assert_true (agent->local_addresses == NULL);
/* add one local address */
nice_agent_add_local_address (agent, &addr_local);
- g_assert (agent->local_addresses != NULL);
+ g_assert_true (agent->local_addresses != NULL);
g_assert_cmpuint (g_slist_length (agent->local_addresses), ==, 1);
- g_assert (nice_address_equal (agent->local_addresses->data, &addr_local));
+ g_assert_true (nice_address_equal (agent->local_addresses->data, &addr_local));
/* add a stream */
stream_id = nice_agent_add_stream (agent, 1);
@@ -103,8 +103,8 @@ main (void)
/* socket manager uses random port number */
nice_address_set_port (&addr_local, 1);
nice_address_set_port (&(candidate->addr), 1);
- g_assert (nice_address_equal (&(candidate->addr), &addr_local));
- g_assert (strncmp (candidate->foundation, "1", 1) == 0);
+ g_assert_true (nice_address_equal (&(candidate->addr), &addr_local));
+ g_assert_true (strncmp (candidate->foundation, "1", 1) == 0);
for (i = candidates; i; i = i->next)
nice_candidate_free ((NiceCandidate *) i->data);
g_slist_free (candidates);