Commit fe55ca06 authored by Jakub Adam's avatar Jakub Adam

tests: Initialize Windows Sockets where needed

Fixes failing test cases on Windows.
parent 83c5d0fc
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include <gio/gio.h> #include <gio/gio.h>
#include <gio/gnetworking.h>
#include <agent.h> #include <agent.h>
static NiceComponentState global_lagent_state[2] = { NICE_COMPONENT_STATE_LAST, NICE_COMPONENT_STATE_LAST }; static NiceComponentState global_lagent_state[2] = { NICE_COMPONENT_STATE_LAST, NICE_COMPONENT_STATE_LAST };
...@@ -250,6 +251,8 @@ main (int argc, char **argv) ...@@ -250,6 +251,8 @@ main (int argc, char **argv)
{ {
int ret; int ret;
g_networking_init ();
g_test_init (&argc, &argv, NULL); g_test_init (&argc, &argv, NULL);
g_test_add_func ("/nice/nomination/regular", regular); g_test_add_func ("/nice/nomination/regular", regular);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#endif #endif
#include <locale.h> #include <locale.h>
#include <gio/gnetworking.h>
#include "socket.h" #include "socket.h"
...@@ -84,6 +85,8 @@ main (int argc, char *argv[]) ...@@ -84,6 +85,8 @@ main (int argc, char *argv[])
NiceAddress addr; NiceAddress addr;
g_networking_init ();
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
g_test_init (&argc, &argv, NULL); g_test_init (&argc, &argv, NULL);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <gio/gnetworking.h>
#include "socket.h" #include "socket.h"
...@@ -88,6 +89,8 @@ main (void) ...@@ -88,6 +89,8 @@ main (void)
NiceAddress active_bind_addr, passive_bind_addr; NiceAddress active_bind_addr, passive_bind_addr;
GSource *srv_listen_source, *srv_input_source, *cli_input_source; GSource *srv_listen_source, *srv_input_source, *cli_input_source;
g_networking_init ();
mainloop = g_main_loop_new (NULL, FALSE); mainloop = g_main_loop_new (NULL, FALSE);
nice_address_init (&active_bind_addr); nice_address_init (&active_bind_addr);
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
# include "config.h" # include "config.h"
#endif #endif
// With _GNU_SOURCE, enumeration in netinet/tcp.h and PseudoTcpState clash
#undef _GNU_SOURCE
#define _POSIX_SOURCE 1
#include <gio/gnetworking.h>
#include "agent-priv.h" #include "agent-priv.h"
#include "socket.h" #include "socket.h"
...@@ -203,6 +208,8 @@ main (int argc, char *argv[]) ...@@ -203,6 +208,8 @@ main (int argc, char *argv[])
{ {
GMainLoop *mainloop; GMainLoop *mainloop;
g_networking_init ();
randg = g_rand_new(); randg = g_rand_new();
g_test_init (&argc, &argv, NULL); g_test_init (&argc, &argv, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment