tests: info: fix post init cat reg test on windows and with CK_FORK=no
authorTim-Philipp Müller <tim@centricular.com>
Thu, 11 Jan 2018 11:38:53 +0000 (11:38 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 11 Jan 2018 11:38:53 +0000 (11:38 +0000)
The test checks that categories not covered by the pattern in the
GST_DEBUG string have debug level GST_LEVEL_DEFAULT set, but previous
tests mess with the default threshold, which made this test fail on
Windows or when run with CK_FORK=no. Fix this by resetting everything
at the beginning, and then also do a sanity check afterwards.

tests/check/gst/gstinfo.c

index 525349a..7ebd967 100644 (file)
@@ -440,7 +440,10 @@ GST_START_TEST (info_post_gst_init_category_registration)
   /* Note: before the fixes this wouldn't work to trigger the problem because
    * only a pattern set via GST_DEBUG before gst_init would be picked up
    * (another bug) */
-  gst_debug_set_threshold_from_string ("*a*b:6,*c:3,d*:2,xyz*:9,ax:1", FALSE);
+  gst_debug_set_threshold_from_string ("*a*b:6,*c:3,d*:2,xyz*:9,ax:1", TRUE);
+
+  fail_unless_equals_int (GST_LEVEL_DEFAULT,
+      gst_debug_get_default_threshold ());
 
   for (i = 0; i < G_N_ELEMENTS (cats); ++i) {
     gchar *name = g_strdup_printf ("%s-%x", (i % 2 == 0) ? "cat" : "dog", i);