From: Benjamin O. <co...@pd...> - 2004-04-05 04:10:18
|
CVS Root: /home/cvs/gstreamer Module: gstreamer Changes by: company Date: Sun Apr 04 2004 21:10:17 PDT Log message: * testsuite/debug/category.c: (main): * testsuite/debug/commandline.c: (main): * testsuite/debug/output.c: (main): fix tests to work again with debugging enabled Modified files: . : ChangeLog testsuite/debug : category.c commandline.c output.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.392&r2=1.393 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/debug/category.c.diff?r1=1.4&r2=1.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/debug/commandline.c.diff?r1=1.8&r2=1.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/debug/output.c.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.392 retrieving revision 1.393 diff -u -d -r1.392 -r1.393 --- a/ChangeLog 5 Apr 2004 02:30:20 -0000 1.392 +++ b/ChangeLog 5 Apr 2004 04:10:04 -0000 1.393 @@ -1,5 +1,12 @@ 2004-04-05 Benjamin Otte <ot...@gn...> + * testsuite/debug/category.c: (main): + * testsuite/debug/commandline.c: (main): + * testsuite/debug/output.c: (main): + fix tests to work again with debugging enabled + +2004-04-05 Benjamin Otte <ot...@gn...> * gst/schedulers/gstbasicscheduler.c: (gst_basic_scheduler_pad_link): fix to work with recent scheduling changes Index: category.c RCS file: /home/cvs/gstreamer/gstreamer/testsuite/debug/category.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- a/category.c 3 Apr 2004 04:16:24 -0000 1.4 +++ b/category.c 5 Apr 2004 04:10:05 -0000 1.5 @@ -42,13 +42,13 @@ after = gst_debug_get_all_categories (); g_print ("removing default log function\n"); - g_assert (gst_debug_remove_log_function (gst_debug_log_default) == - (GST_DISABLE_GST_DEBUG ? 0 : 1)); +#ifdef GST_DISABLE_GST_DEBUG + g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 0); +#else + g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 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) == - (GST_DISABLE_GST_DEBUG ? 0 : 2)); -#ifndef GST_DISABLE_GST_DEBUG + g_assert (g_slist_length (after) - g_slist_length (before) == 2); /* check the _get stuff */ ("checking, if the gst_debug_category_get_* stuff works with the categories...\n"); Index: commandline.c RCS file: /home/cvs/gstreamer/gstreamer/testsuite/debug/commandline.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- a/commandline.c 3 Apr 2004 04:16:24 -0000 1.8 +++ b/commandline.c 5 Apr 2004 04:10:05 -0000 1.9 @@ -34,13 +34,15 @@ "--gst-debug-level=4 --gst-debug=cat_*:5" }; -static void G_GNUC_UNUSED +#ifndef GST_DISABLE_GST_DEBUG +static void debug_not_reached (GstDebugCategory * category, GstDebugLevel level, const gchar * file, const gchar * function, gint line, GObject * object, GstDebugMessage * message, gpointer thread) { g_assert_not_reached (); } +#endif gint main (gint argc, gchar * argv[]) @@ -52,7 +54,8 @@ unsetenv ("GST_DEBUG"); gst_init (&argc, &argv); - runs = (GST_DISABLE_GST_DEBUG ? 0 : G_N_ELEMENTS (lines)); + runs = 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); @@ -62,6 +65,7 @@ g_print ("\"%s\" worked as expected.\n", command); g_free (command); } return 0; } else { @@ -71,15 +75,17 @@ ("something funny happened to the command line arguments, aborting.\n"); return 1; - g_assert (gst_debug_remove_log_function (gst_debug_log_default) != - GST_DISABLE_GST_DEBUG); + g_assert (gst_debug_remove_log_function (gst_debug_log_default) == 1); 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); - g_assert (gst_debug_add_log_function (debug_not_reached, - NULL) != GST_DISABLE_GST_DEBUG); + gst_debug_add_log_function (debug_not_reached, NULL); GST_ERROR ("This will not be seen"); return 0; case '1': Index: output.c RCS file: /home/cvs/gstreamer/gstreamer/testsuite/debug/output.c,v --- a/output.c 3 Apr 2004 04:16:24 -0000 1.4 +++ b/output.c 5 Apr 2004 04:10:05 -0000 1.5 @@ -65,10 +65,10 @@ "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) != - GST_DISABLE_GST_DEBUG); - g_assert (gst_debug_add_log_function (check_message, - NULL) != GST_DISABLE_GST_DEBUG); + gst_debug_add_log_function (check_message, NULL); count = 0; GST_ERROR ("This is an error."); @@ -119,8 +119,9 @@ "This is a log message with category and object."); count = -1; - g_assert (gst_debug_remove_log_function (check_message) == + g_assert (gst_debug_remove_log_function (check_message) == 1); return 0; |