fix to successfully build and test with --disable-gst-debug configure switch
authorBenjamin Otte <otte@gnome.org>
Sat, 3 Apr 2004 04:16:24 +0000 (04:16 +0000)
committerBenjamin Otte <otte@gnome.org>
Sat, 3 Apr 2004 04:16:24 +0000 (04:16 +0000)
Original commit message from CVS:
* gst/autoplug/gstspider.c: (gst_spider_identity_plug):
* gst/gstinfo.h:
* testsuite/debug/category.c: (main):
* testsuite/debug/commandline.c: (main):
* testsuite/debug/output.c: (main):
* testsuite/debug/printf_extension.c: (main):
fix to successfully build and test with --disable-gst-debug
configure switch

ChangeLog
gst/autoplug/gstspider.c
gst/gstinfo.h
tests/old/testsuite/debug/category.c
tests/old/testsuite/debug/commandline.c
tests/old/testsuite/debug/output.c
tests/old/testsuite/debug/printf_extension.c
testsuite/debug/category.c
testsuite/debug/commandline.c
testsuite/debug/output.c
testsuite/debug/printf_extension.c

index 869fb60..60ac3f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2004-04-03  Benjamin Otte  <otte@gnome.org>
 
+       * gst/autoplug/gstspider.c: (gst_spider_identity_plug):
+       * gst/gstinfo.h:
+       * testsuite/debug/category.c: (main):
+       * testsuite/debug/commandline.c: (main):
+       * testsuite/debug/output.c: (main):
+       * testsuite/debug/printf_extension.c: (main):
+         fix to successfully build and test with --disable-gst-debug
+         configure switch
+
+2004-04-03  Benjamin Otte  <otte@gnome.org>
+
        * docs/pwg/building-boiler.xml:
          add cvs login line and s/anonymous/anoncvs/
 
index 9cc6a72..6de4e59 100644 (file)
@@ -434,9 +434,8 @@ gst_spider_identity_plug (GstSpiderIdentity * ident)
       while (factories) {
         if ((padtemp =
                 gst_autoplug_can_connect_src (factories->data, src_caps))) {
-          const GstCaps *caps = gst_pad_template_get_caps (padtemp);
-
-          GST_DEBUG ("can connect src to pad template: %" GST_PTR_FORMAT, caps);
+          GST_DEBUG ("can connect src to pad template: %" GST_PTR_FORMAT,
+              gst_pad_template_get_caps (padtemp));
           found = TRUE;
         }
         factories = factories->next;
index 28df24f..7f76ce2 100644 (file)
@@ -399,7 +399,6 @@ G_CONST_RETURN gchar*
 #ifdef __GNUC__
 #  pragma GCC poison gst_debug_log
 #  pragma GCC poison gst_debug_log_valist
-#  pragma GCC poison gst_debug_log_default
 #  pragma GCC poison _gst_debug_category_new
 #endif
 
index cd1c89d..69051c8 100644 (file)
@@ -42,10 +42,13 @@ main (gint argc, gchar * argv[])
   after = gst_debug_get_all_categories ();
 
   g_print ("removing default log function\n");
-  g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1);
+  g_assert (gst_debug_remove_log_function (gst_debug_log_default) ==
+      (GST_DISABLE_GST_DEBUG ? 0 : 1));
   g_print
       ("checking, if the two new categories are put into the category list correctly...\n");
-  g_assert (g_slist_length (after) - g_slist_length (before) == 2);
+  g_assert (g_slist_length (after) - g_slist_length (before) ==
+      (GST_DISABLE_GST_DEBUG ? 0 : 2));
+#ifndef GST_DISABLE_GST_DEBUG
   /* check the _get stuff */
   g_print
       ("checking, if the gst_debug_category_get_* stuff works with the categories...\n");
@@ -74,6 +77,7 @@ main (gint argc, gchar * argv[])
   gst_debug_set_threshold_for_name ("cat_static", GST_LEVEL_INFO);
   g_assert (gst_debug_category_get_threshold (cat) == GST_LEVEL_DEBUG);
   g_assert (gst_debug_category_get_threshold (cat_static) == GST_LEVEL_INFO);
+#endif
 
   g_print ("everything ok.\n");
   return 0;
index 48502fe..61f513c 100644 (file)
@@ -34,7 +34,7 @@ static const gchar *lines[] = {
   "--gst-debug-level=4 --gst-debug=cat_*:5"
 };
 
-static void
+static void G_GNUC_UNUSED
 debug_not_reached (GstDebugCategory * category, GstDebugLevel level,
     const gchar * file, const gchar * function, gint line, GObject * object,
     GstDebugMessage * message, gpointer thread)
@@ -52,7 +52,7 @@ main (gint argc, gchar * argv[])
 
     unsetenv ("GST_DEBUG");
     gst_init (&argc, &argv);
-    runs = G_N_ELEMENTS (lines);
+    runs = (GST_DISABLE_GST_DEBUG ? 0 : G_N_ELEMENTS (lines));
     for (i = 0; i < runs; i++) {
       command = g_strdup_printf ("%s %s %d", argv[0], lines[i], i);
       g_print ("running \"%s\"\n", command);
@@ -71,13 +71,15 @@ main (gint argc, gchar * argv[])
           ("something funny happened to the command line arguments, aborting.\n");
       return 1;
     }
-    gst_debug_remove_log_function (gst_debug_log_default);
+    g_assert (gst_debug_remove_log_function (gst_debug_log_default) !=
+        GST_DISABLE_GST_DEBUG);
     GST_DEBUG_CATEGORY_INIT (cat, "cat", 0, "non-static category");
     GST_DEBUG_CATEGORY_INIT (cat_static, "cat_static", 0, "static category");
     switch (argv[1][0]) {
       case '0':
         g_assert (gst_debug_is_active () == FALSE);
-        gst_debug_add_log_function (debug_not_reached, NULL);
+        g_assert (gst_debug_add_log_function (debug_not_reached,
+                NULL) != GST_DISABLE_GST_DEBUG);
         GST_ERROR ("This will not be seen");
         return 0;
       case '1':
index 50ca668..953bdec 100644 (file)
@@ -27,6 +27,7 @@ GST_DEBUG_CATEGORY_STATIC (cat2);
 static gint count = -1;
 static GstElement *pipeline;
 
+#ifndef GST_DISABLE_GST_DEBUG
 static void
 check_message (GstDebugCategory * category, GstDebugLevel level,
     const gchar * file, const gchar * function, gint line, GObject * object,
@@ -52,6 +53,7 @@ check_message (GstDebugCategory * category, GstDebugLevel level,
   g_assert (object == (GObject *) (temp ? pipeline : NULL));
   g_print ("[OK]\n");
 }
+#endif
 
 gint
 main (gint argc, gchar * argv[])
@@ -63,8 +65,10 @@ main (gint argc, gchar * argv[])
       "default category for this test");
   GST_DEBUG_CATEGORY_INIT (cat2, "GST_Check_2", 0,
       "second category for this test");
-  g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1);
-  gst_debug_add_log_function (check_message, NULL);
+  g_assert (gst_debug_remove_log_function (gst_debug_log_default) !=
+      GST_DISABLE_GST_DEBUG);
+  g_assert (gst_debug_add_log_function (check_message,
+          NULL) != GST_DISABLE_GST_DEBUG);
 
   count = 0;
   GST_ERROR ("This is an error.");
@@ -115,7 +119,8 @@ main (gint argc, gchar * argv[])
       "This is a log message with category and object.");
   count = -1;
 
-  g_assert (gst_debug_remove_log_function (check_message) == 1);
+  g_assert (gst_debug_remove_log_function (check_message) ==
+      (GST_DISABLE_GST_DEBUG ? 0 : 1));
 
   return 0;
 }
index 8cdfccc..cc02284 100644 (file)
@@ -23,7 +23,7 @@ main (gint argc, gchar * argv[])
 {
   GstCaps *caps;
   GstElement *element;
-  int zero = 0;
+  G_GNUC_UNUSED int zero = 0;
 
   gst_init (&argc, &argv);
 
index cd1c89d..69051c8 100644 (file)
@@ -42,10 +42,13 @@ main (gint argc, gchar * argv[])
   after = gst_debug_get_all_categories ();
 
   g_print ("removing default log function\n");
-  g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1);
+  g_assert (gst_debug_remove_log_function (gst_debug_log_default) ==
+      (GST_DISABLE_GST_DEBUG ? 0 : 1));
   g_print
       ("checking, if the two new categories are put into the category list correctly...\n");
-  g_assert (g_slist_length (after) - g_slist_length (before) == 2);
+  g_assert (g_slist_length (after) - g_slist_length (before) ==
+      (GST_DISABLE_GST_DEBUG ? 0 : 2));
+#ifndef GST_DISABLE_GST_DEBUG
   /* check the _get stuff */
   g_print
       ("checking, if the gst_debug_category_get_* stuff works with the categories...\n");
@@ -74,6 +77,7 @@ main (gint argc, gchar * argv[])
   gst_debug_set_threshold_for_name ("cat_static", GST_LEVEL_INFO);
   g_assert (gst_debug_category_get_threshold (cat) == GST_LEVEL_DEBUG);
   g_assert (gst_debug_category_get_threshold (cat_static) == GST_LEVEL_INFO);
+#endif
 
   g_print ("everything ok.\n");
   return 0;
index 48502fe..61f513c 100644 (file)
@@ -34,7 +34,7 @@ static const gchar *lines[] = {
   "--gst-debug-level=4 --gst-debug=cat_*:5"
 };
 
-static void
+static void G_GNUC_UNUSED
 debug_not_reached (GstDebugCategory * category, GstDebugLevel level,
     const gchar * file, const gchar * function, gint line, GObject * object,
     GstDebugMessage * message, gpointer thread)
@@ -52,7 +52,7 @@ main (gint argc, gchar * argv[])
 
     unsetenv ("GST_DEBUG");
     gst_init (&argc, &argv);
-    runs = G_N_ELEMENTS (lines);
+    runs = (GST_DISABLE_GST_DEBUG ? 0 : G_N_ELEMENTS (lines));
     for (i = 0; i < runs; i++) {
       command = g_strdup_printf ("%s %s %d", argv[0], lines[i], i);
       g_print ("running \"%s\"\n", command);
@@ -71,13 +71,15 @@ main (gint argc, gchar * argv[])
           ("something funny happened to the command line arguments, aborting.\n");
       return 1;
     }
-    gst_debug_remove_log_function (gst_debug_log_default);
+    g_assert (gst_debug_remove_log_function (gst_debug_log_default) !=
+        GST_DISABLE_GST_DEBUG);
     GST_DEBUG_CATEGORY_INIT (cat, "cat", 0, "non-static category");
     GST_DEBUG_CATEGORY_INIT (cat_static, "cat_static", 0, "static category");
     switch (argv[1][0]) {
       case '0':
         g_assert (gst_debug_is_active () == FALSE);
-        gst_debug_add_log_function (debug_not_reached, NULL);
+        g_assert (gst_debug_add_log_function (debug_not_reached,
+                NULL) != GST_DISABLE_GST_DEBUG);
         GST_ERROR ("This will not be seen");
         return 0;
       case '1':
index 50ca668..953bdec 100644 (file)
@@ -27,6 +27,7 @@ GST_DEBUG_CATEGORY_STATIC (cat2);
 static gint count = -1;
 static GstElement *pipeline;
 
+#ifndef GST_DISABLE_GST_DEBUG
 static void
 check_message (GstDebugCategory * category, GstDebugLevel level,
     const gchar * file, const gchar * function, gint line, GObject * object,
@@ -52,6 +53,7 @@ check_message (GstDebugCategory * category, GstDebugLevel level,
   g_assert (object == (GObject *) (temp ? pipeline : NULL));
   g_print ("[OK]\n");
 }
+#endif
 
 gint
 main (gint argc, gchar * argv[])
@@ -63,8 +65,10 @@ main (gint argc, gchar * argv[])
       "default category for this test");
   GST_DEBUG_CATEGORY_INIT (cat2, "GST_Check_2", 0,
       "second category for this test");
-  g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1);
-  gst_debug_add_log_function (check_message, NULL);
+  g_assert (gst_debug_remove_log_function (gst_debug_log_default) !=
+      GST_DISABLE_GST_DEBUG);
+  g_assert (gst_debug_add_log_function (check_message,
+          NULL) != GST_DISABLE_GST_DEBUG);
 
   count = 0;
   GST_ERROR ("This is an error.");
@@ -115,7 +119,8 @@ main (gint argc, gchar * argv[])
       "This is a log message with category and object.");
   count = -1;
 
-  g_assert (gst_debug_remove_log_function (check_message) == 1);
+  g_assert (gst_debug_remove_log_function (check_message) ==
+      (GST_DISABLE_GST_DEBUG ? 0 : 1));
 
   return 0;
 }
index 8cdfccc..cc02284 100644 (file)
@@ -23,7 +23,7 @@ main (gint argc, gchar * argv[])
 {
   GstCaps *caps;
   GstElement *element;
-  int zero = 0;
+  G_GNUC_UNUSED int zero = 0;
 
   gst_init (&argc, &argv);