fix to successfully build and test with --disable-gst-debug configure switch

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
This commit is contained in:
Benjamin Otte 2004-04-03 04:16:24 +00:00
parent fb4ca9559b
commit 75f4ff0686
11 changed files with 55 additions and 24 deletions

View file

@ -1,3 +1,14 @@
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> 2004-04-03 Benjamin Otte <otte@gnome.org>
* docs/pwg/building-boiler.xml: * docs/pwg/building-boiler.xml:

View file

@ -434,9 +434,8 @@ gst_spider_identity_plug (GstSpiderIdentity * ident)
while (factories) { while (factories) {
if ((padtemp = if ((padtemp =
gst_autoplug_can_connect_src (factories->data, src_caps))) { 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,
gst_pad_template_get_caps (padtemp));
GST_DEBUG ("can connect src to pad template: %" GST_PTR_FORMAT, caps);
found = TRUE; found = TRUE;
} }
factories = factories->next; factories = factories->next;

View file

@ -399,7 +399,6 @@ G_CONST_RETURN gchar*
#ifdef __GNUC__ #ifdef __GNUC__
# pragma GCC poison gst_debug_log # pragma GCC poison gst_debug_log
# pragma GCC poison gst_debug_log_valist # pragma GCC poison gst_debug_log_valist
# pragma GCC poison gst_debug_log_default
# pragma GCC poison _gst_debug_category_new # pragma GCC poison _gst_debug_category_new
#endif #endif

View file

@ -42,10 +42,13 @@ main (gint argc, gchar * argv[])
after = gst_debug_get_all_categories (); after = gst_debug_get_all_categories ();
g_print ("removing default log function\n"); 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 g_print
("checking, if the two new categories are put into the category list correctly...\n"); ("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 */ /* check the _get stuff */
g_print g_print
("checking, if the gst_debug_category_get_* stuff works with the categories...\n"); ("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); 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) == GST_LEVEL_DEBUG);
g_assert (gst_debug_category_get_threshold (cat_static) == GST_LEVEL_INFO); g_assert (gst_debug_category_get_threshold (cat_static) == GST_LEVEL_INFO);
#endif
g_print ("everything ok.\n"); g_print ("everything ok.\n");
return 0; return 0;

View file

@ -34,7 +34,7 @@ static const gchar *lines[] = {
"--gst-debug-level=4 --gst-debug=cat_*:5" "--gst-debug-level=4 --gst-debug=cat_*:5"
}; };
static void static void G_GNUC_UNUSED
debug_not_reached (GstDebugCategory * category, GstDebugLevel level, debug_not_reached (GstDebugCategory * category, GstDebugLevel level,
const gchar * file, const gchar * function, gint line, GObject * object, const gchar * file, const gchar * function, gint line, GObject * object,
GstDebugMessage * message, gpointer thread) GstDebugMessage * message, gpointer thread)
@ -52,7 +52,7 @@ main (gint argc, gchar * argv[])
unsetenv ("GST_DEBUG"); unsetenv ("GST_DEBUG");
gst_init (&argc, &argv); 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++) { for (i = 0; i < runs; i++) {
command = g_strdup_printf ("%s %s %d", argv[0], lines[i], i); command = g_strdup_printf ("%s %s %d", argv[0], lines[i], i);
g_print ("running \"%s\"\n", command); 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"); ("something funny happened to the command line arguments, aborting.\n");
return 1; 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, "cat", 0, "non-static category");
GST_DEBUG_CATEGORY_INIT (cat_static, "cat_static", 0, "static category"); GST_DEBUG_CATEGORY_INIT (cat_static, "cat_static", 0, "static category");
switch (argv[1][0]) { switch (argv[1][0]) {
case '0': case '0':
g_assert (gst_debug_is_active () == FALSE); 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"); GST_ERROR ("This will not be seen");
return 0; return 0;
case '1': case '1':

View file

@ -27,6 +27,7 @@ GST_DEBUG_CATEGORY_STATIC (cat2);
static gint count = -1; static gint count = -1;
static GstElement *pipeline; static GstElement *pipeline;
#ifndef GST_DISABLE_GST_DEBUG
static void static void
check_message (GstDebugCategory * category, GstDebugLevel level, check_message (GstDebugCategory * category, GstDebugLevel level,
const gchar * file, const gchar * function, gint line, GObject * object, 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_assert (object == (GObject *) (temp ? pipeline : NULL));
g_print ("[OK]\n"); g_print ("[OK]\n");
} }
#endif
gint gint
main (gint argc, gchar * argv[]) main (gint argc, gchar * argv[])
@ -63,8 +65,10 @@ main (gint argc, gchar * argv[])
"default category for this test"); "default category for this test");
GST_DEBUG_CATEGORY_INIT (cat2, "GST_Check_2", 0, GST_DEBUG_CATEGORY_INIT (cat2, "GST_Check_2", 0,
"second category for this test"); "second category for this test");
g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1); g_assert (gst_debug_remove_log_function (gst_debug_log_default) !=
gst_debug_add_log_function (check_message, NULL); GST_DISABLE_GST_DEBUG);
g_assert (gst_debug_add_log_function (check_message,
NULL) != GST_DISABLE_GST_DEBUG);
count = 0; count = 0;
GST_ERROR ("This is an error."); GST_ERROR ("This is an error.");
@ -115,7 +119,8 @@ main (gint argc, gchar * argv[])
"This is a log message with category and object."); "This is a log message with category and object.");
count = -1; 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; return 0;
} }

View file

@ -23,7 +23,7 @@ main (gint argc, gchar * argv[])
{ {
GstCaps *caps; GstCaps *caps;
GstElement *element; GstElement *element;
int zero = 0; G_GNUC_UNUSED int zero = 0;
gst_init (&argc, &argv); gst_init (&argc, &argv);

View file

@ -42,10 +42,13 @@ main (gint argc, gchar * argv[])
after = gst_debug_get_all_categories (); after = gst_debug_get_all_categories ();
g_print ("removing default log function\n"); 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 g_print
("checking, if the two new categories are put into the category list correctly...\n"); ("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 */ /* check the _get stuff */
g_print g_print
("checking, if the gst_debug_category_get_* stuff works with the categories...\n"); ("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); 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) == GST_LEVEL_DEBUG);
g_assert (gst_debug_category_get_threshold (cat_static) == GST_LEVEL_INFO); g_assert (gst_debug_category_get_threshold (cat_static) == GST_LEVEL_INFO);
#endif
g_print ("everything ok.\n"); g_print ("everything ok.\n");
return 0; return 0;

View file

@ -34,7 +34,7 @@ static const gchar *lines[] = {
"--gst-debug-level=4 --gst-debug=cat_*:5" "--gst-debug-level=4 --gst-debug=cat_*:5"
}; };
static void static void G_GNUC_UNUSED
debug_not_reached (GstDebugCategory * category, GstDebugLevel level, debug_not_reached (GstDebugCategory * category, GstDebugLevel level,
const gchar * file, const gchar * function, gint line, GObject * object, const gchar * file, const gchar * function, gint line, GObject * object,
GstDebugMessage * message, gpointer thread) GstDebugMessage * message, gpointer thread)
@ -52,7 +52,7 @@ main (gint argc, gchar * argv[])
unsetenv ("GST_DEBUG"); unsetenv ("GST_DEBUG");
gst_init (&argc, &argv); 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++) { for (i = 0; i < runs; i++) {
command = g_strdup_printf ("%s %s %d", argv[0], lines[i], i); command = g_strdup_printf ("%s %s %d", argv[0], lines[i], i);
g_print ("running \"%s\"\n", command); 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"); ("something funny happened to the command line arguments, aborting.\n");
return 1; 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, "cat", 0, "non-static category");
GST_DEBUG_CATEGORY_INIT (cat_static, "cat_static", 0, "static category"); GST_DEBUG_CATEGORY_INIT (cat_static, "cat_static", 0, "static category");
switch (argv[1][0]) { switch (argv[1][0]) {
case '0': case '0':
g_assert (gst_debug_is_active () == FALSE); 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"); GST_ERROR ("This will not be seen");
return 0; return 0;
case '1': case '1':

View file

@ -27,6 +27,7 @@ GST_DEBUG_CATEGORY_STATIC (cat2);
static gint count = -1; static gint count = -1;
static GstElement *pipeline; static GstElement *pipeline;
#ifndef GST_DISABLE_GST_DEBUG
static void static void
check_message (GstDebugCategory * category, GstDebugLevel level, check_message (GstDebugCategory * category, GstDebugLevel level,
const gchar * file, const gchar * function, gint line, GObject * object, 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_assert (object == (GObject *) (temp ? pipeline : NULL));
g_print ("[OK]\n"); g_print ("[OK]\n");
} }
#endif
gint gint
main (gint argc, gchar * argv[]) main (gint argc, gchar * argv[])
@ -63,8 +65,10 @@ main (gint argc, gchar * argv[])
"default category for this test"); "default category for this test");
GST_DEBUG_CATEGORY_INIT (cat2, "GST_Check_2", 0, GST_DEBUG_CATEGORY_INIT (cat2, "GST_Check_2", 0,
"second category for this test"); "second category for this test");
g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1); g_assert (gst_debug_remove_log_function (gst_debug_log_default) !=
gst_debug_add_log_function (check_message, NULL); GST_DISABLE_GST_DEBUG);
g_assert (gst_debug_add_log_function (check_message,
NULL) != GST_DISABLE_GST_DEBUG);
count = 0; count = 0;
GST_ERROR ("This is an error."); GST_ERROR ("This is an error.");
@ -115,7 +119,8 @@ main (gint argc, gchar * argv[])
"This is a log message with category and object."); "This is a log message with category and object.");
count = -1; 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; return 0;
} }

View file

@ -23,7 +23,7 @@ main (gint argc, gchar * argv[])
{ {
GstCaps *caps; GstCaps *caps;
GstElement *element; GstElement *element;
int zero = 0; G_GNUC_UNUSED int zero = 0;
gst_init (&argc, &argv); gst_init (&argc, &argv);