* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "gio.h"
g_clear_error (&error);
}
}
+
+ g_main_loop_unref (data.loop);
}
static void
m = g_network_monitor_get_default ();
g_assert (G_IS_NETWORK_MONITOR (m));
- monitor = g_initable_new (G_TYPE_NETWORK_MONITOR_BASE, NULL, &error, NULL);
+ monitor = g_initable_newv (G_TYPE_NETWORK_MONITOR_BASE, 0, NULL, NULL, &error);
g_assert_no_error (error);
/* In the default configuration, all addresses are reachable */
}
static void
+cleanup_test (TestMask *test)
+{
+ int i;
+
+ g_object_unref (test->mask);
+ for (i = 0; test->addresses[i].string; i++)
+ g_object_unref (test->addresses[i].address);
+}
+
+static void
watch_network_changed (GNetworkMonitor *monitor,
gboolean available,
gpointer user_data)
int
main (int argc, char **argv)
{
- g_type_init ();
+ int ret;
if (argc == 2 && !strcmp (argv[1], "--watch"))
{
g_test_add_func ("/network-monitor/add_networks", test_add_networks);
g_test_add_func ("/network-monitor/remove_networks", test_remove_networks);
- return g_test_run ();
+ ret = g_test_run ();
+
+ cleanup_test (&net127);
+ cleanup_test (&net10);
+ cleanup_test (&net192);
+ cleanup_test (&netlocal6);
+ cleanup_test (&netfe80);
+ g_object_unref (ip4_default);
+ g_object_unref (ip6_default);
+
+ return ret;
}