[tracker/functions] tests: Use g_assert_no_error now that we depend on GLib 2.20



commit 4bb3450c8fe9eefeb7221fb9591bd46c9ceb31fc
Author: Jürg Billeter <j bitron ch>
Date:   Mon Dec 28 14:48:40 2009 +0100

    tests: Use g_assert_no_error now that we depend on GLib 2.20

 tests/libtracker-data/tracker-ontology-test.c     |   10 +++++-----
 tests/libtracker-data/tracker-sparql-blank-test.c |    2 +-
 tests/libtracker-data/tracker-sparql-test.c       |   10 +++++-----
 tests/libtracker-fts/tracker-fts-test.c           |   12 ++++++------
 4 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index c8a87be..2110bd6 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -102,15 +102,15 @@ test_query (gconstpointer test_data)
 	tracker_data_begin_transaction ();
 	tracker_turtle_reader_load (data_filename, &error);
 	tracker_data_commit_transaction ();
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	query_filename = g_strconcat (test_prefix, ".rq", NULL);
 	g_file_get_contents (query_filename, &query, NULL, &error);
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	results_filename = g_strconcat (test_prefix, ".out", NULL);
 	g_file_get_contents (results_filename, &results, NULL, &error);
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	g_free (data_prefix);
 	g_free (test_prefix);
@@ -118,7 +118,7 @@ test_query (gconstpointer test_data)
 	/* perform actual query */
 
 	result_set = tracker_data_query_sparql (query, &error);
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	/* compare results with reference output */
 
@@ -178,7 +178,7 @@ test_query (gconstpointer test_data)
 		quoted_command_line = g_shell_quote (command_line);
 		shell = g_strdup_printf ("sh -c %s", quoted_command_line);
 		g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
-		g_assert (error == NULL);
+		g_assert_no_error (error);
 
 		g_error ("%s", diff);
 
diff --git a/tests/libtracker-data/tracker-sparql-blank-test.c b/tests/libtracker-data/tracker-sparql-blank-test.c
index 35311e7..7788290 100644
--- a/tests/libtracker-data/tracker-sparql-blank-test.c
+++ b/tests/libtracker-data/tracker-sparql-blank-test.c
@@ -53,7 +53,7 @@ test_blank (void)
 	                                            "INSERT { _:foo a rdfs:Resource . _:bar a rdfs:Resource } ",
 	                                            &error);
 	tracker_data_commit_transaction ();
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	g_assert_cmpint (updates->len, ==, 2);
 
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index 2b193b0..563b671 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -125,15 +125,15 @@ test_sparql_query (gconstpointer test_data)
 	tracker_data_begin_transaction ();
 	tracker_turtle_reader_load (data_filename, &error);
 	tracker_data_commit_transaction ();
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	query_filename = g_strconcat (test_prefix, ".rq", NULL);
 	g_file_get_contents (query_filename, &query, NULL, &error);
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	results_filename = g_strconcat (test_prefix, ".out", NULL);
 	g_file_get_contents (results_filename, &results, NULL, &error);
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	g_free (data_prefix);
 	g_free (test_prefix);
@@ -147,7 +147,7 @@ test_sparql_query (gconstpointer test_data)
 		g_assert (error != NULL);
 	} else {
 		comparer = strcmp;
-		g_assert (error == NULL);
+		g_assert_no_error (error);
 	}
 
 	/* compare results with reference output */
@@ -211,7 +211,7 @@ test_sparql_query (gconstpointer test_data)
 		quoted_command_line = g_shell_quote (command_line);
 		shell = g_strdup_printf ("sh -c %s", quoted_command_line);
 		g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
-		g_assert (error == NULL);
+		g_assert_no_error (error);
 
 		g_error ("%s", diff);
 
diff --git a/tests/libtracker-fts/tracker-fts-test.c b/tests/libtracker-fts/tracker-fts-test.c
index 44f3817..a39fabc 100644
--- a/tests/libtracker-fts/tracker-fts-test.c
+++ b/tests/libtracker-fts/tracker-fts-test.c
@@ -76,12 +76,12 @@ test_sparql_query (gconstpointer test_data)
 
 	update_filename = g_strconcat (test_prefix, "-data.rq", NULL);
 	g_file_get_contents (update_filename, &update, NULL, &error);
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	tracker_data_begin_transaction ();
 	tracker_data_update_sparql (update, &error);
 	tracker_data_commit_transaction ();
-	g_assert (error == NULL);
+	g_assert_no_error (error);
 
 	g_free (update_filename);
 	g_free (update);
@@ -91,14 +91,14 @@ test_sparql_query (gconstpointer test_data)
 	for (i = 1; i <= test_info->number_of_queries; i++) {
 		query_filename = g_strdup_printf ("%s-%d.rq", test_prefix, i);
 		g_file_get_contents (query_filename, &query, NULL, &error);
-		g_assert (error == NULL);
+		g_assert_no_error (error);
 
 		results_filename = g_strdup_printf ("%s-%d.out", test_prefix, i);
 		g_file_get_contents (results_filename, &results, NULL, &error);
-		g_assert (error == NULL);
+		g_assert_no_error (error);
 
 		result_set = tracker_data_query_sparql (query, &error);
-		g_assert (error == NULL);
+		g_assert_no_error (error);
 
 		/* compare results with reference output */
 
@@ -158,7 +158,7 @@ test_sparql_query (gconstpointer test_data)
 			quoted_command_line = g_shell_quote (command_line);
 			shell = g_strdup_printf ("sh -c %s", quoted_command_line);
 			g_spawn_command_line_sync (shell, &diff, NULL, NULL, &error);
-			g_assert (error == NULL);
+			g_assert_no_error (error);
 
 			g_error ("%s", diff);
 



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