[totem-pl-parser] Add more debug when a parse error happens



commit aa5ce8f3b1deeef1f44c39bb1d528b991f924336
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jul 23 19:57:12 2009 +0100

    Add more debug when a parse error happens
    
    2009-07-23  Bastien Nocera  <hadess hadess net>
    
    	* plparse/tests/parser.c (test_data_get_data), (test_parsability):
    	Add more debug when a parse error happens

 ChangeLog              |    5 +++++
 plparse/tests/parser.c |    9 ++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 369ae20..3c43780 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-23  Bastien Nocera  <hadess hadess net>
+
+	* plparse/tests/parser.c (test_data_get_data), (test_parsability):
+	Add more debug when a parse error happens
+
 2009-06-30  Bastien Nocera  <hadess hadess net>
 
 	* plparse/totem-disc.c (cd_cache_local_file_to_archive):
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index 66a7a00..6786420 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -128,7 +128,7 @@ test_data_get_data (const char *uri, guint *len)
 	/* Open the file. */
 	stream = g_file_read (file, NULL, &error);
 	if (stream == NULL) {
-		g_test_message ("URI '%s' couldn't be opened in test_data_get_data: '%s'\n", uri, error->message);
+		g_test_message ("URI '%s' couldn't be opened in test_data_get_data: '%s'", uri, error->message);
 		g_error_free (error);
 		return NULL;
 	}
@@ -142,7 +142,7 @@ test_data_get_data (const char *uri, guint *len)
 	}
 
 	if (bytes_read == -1) {
-		g_test_message ("URI '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, error->message);
+		g_test_message ("URI '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'", uri, error->message);
 		g_error_free (error);
 		g_free (buffer);
 		return NULL;
@@ -196,7 +196,10 @@ test_parsability (void)
 		parsable = totem_pl_parser_can_parse_from_data (data, len, TRUE);
 		g_free (data);
 
-		g_assert (parsable == files[i].parsable);
+		if (parsable != files[i].parsable) {
+			g_test_message ("Failed to parse '%s' (idx %d)", files[i].uri, i);
+			g_assert_not_reached ();
+		}
 	}
 
 	/* Loop through again by filename */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]