[rhythmbox] podcast test programs are linked with the real rb_debug now
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] podcast test programs are linked with the real rb_debug now
- Date: Thu, 4 Nov 2021 23:01:48 +0000 (UTC)
commit bcb8e4b1de991c1cb3e8d404c2ba10dc28efa161
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Jan 13 12:26:10 2019 +1000
podcast test programs are linked with the real rb_debug now
podcast/test-podcast-parse.c | 34 ++--------------------------------
podcast/test-podcast-search.c | 31 +------------------------------
2 files changed, 3 insertions(+), 62 deletions(-)
---
diff --git a/podcast/test-podcast-parse.c b/podcast/test-podcast-parse.c
index f6c847a00..ffa8d2bfa 100644
--- a/podcast/test-podcast-parse.c
+++ b/podcast/test-podcast-parse.c
@@ -32,41 +32,12 @@
#include <glib-object.h>
#include <glib/gi18n.h>
+#include "rb-debug.h"
#include "rb-util.h"
#include "rb-podcast-parse.h"
#include <string.h>
-static gboolean debug = FALSE;
-
-void rb_debug_realf (const char *func,
- const char *file,
- int line,
- gboolean newline,
- const char *format, ...) G_GNUC_PRINTF (5, 6);
-
-/* For the benefit of the podcast parsing code */
-void
-rb_debug_realf (const char *func,
- const char *file,
- int line,
- gboolean newline,
- const char *format, ...)
-{
- va_list args;
- char buffer[1025];
-
- if (debug == FALSE)
- return;
-
- va_start (args, format);
- g_vsnprintf (buffer, 1024, format, args);
- va_end (args);
-
- g_printerr (newline ? "%s:%d [%s] %s\n" : "%s:%d [%s] %s",
- file, line, func, buffer);
-}
-
static void
parse_cb (RBPodcastChannel *channel, GError *error, gpointer user_data)
{
@@ -121,7 +92,7 @@ main (int argc, char **argv)
rb_threads_init ();
if (argv[2] != NULL && strcmp (argv[2], "--debug") == 0) {
- debug = TRUE;
+ rb_debug_init (TRUE);
}
ml = g_main_loop_new (NULL, FALSE);
@@ -133,4 +104,3 @@ main (int argc, char **argv)
return 0;
}
-
diff --git a/podcast/test-podcast-search.c b/podcast/test-podcast-search.c
index 6c37bf009..58498f652 100644
--- a/podcast/test-podcast-search.c
+++ b/podcast/test-podcast-search.c
@@ -37,37 +37,8 @@
#include <string.h>
-static gboolean debug = FALSE;
static int done = 0;
-void rb_debug_realf (const char *func,
- const char *file,
- int line,
- gboolean newline,
- const char *format, ...) G_GNUC_PRINTF (5, 6);
-
-/* For the benefit of the podcast parsing code */
-void
-rb_debug_realf (const char *func,
- const char *file,
- int line,
- gboolean newline,
- const char *format, ...)
-{
- va_list args;
- char buffer[1025];
-
- if (debug == FALSE)
- return;
-
- va_start (args, format);
- g_vsnprintf (buffer, 1024, format, args);
- va_end (args);
-
- g_printerr (newline ? "%s:%d [%s] %s\n" : "%s:%d [%s] %s",
- file, line, func, buffer);
-}
-
static void
result_cb (RBPodcastSearch *search, RBPodcastChannel *data)
{
@@ -131,7 +102,7 @@ int main (int argc, char **argv)
text = argv[1];
if (argv[2] != NULL && strcmp (argv[2], "--debug") == 0) {
- debug = TRUE;
+ rb_debug_init (TRUE);
}
loop = g_main_loop_new (NULL, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]