[tracker/dbus-fd-experiment-gio: 6/11] Steroids tests: Check number of returned rows



commit c43c80569ed9b61ca395319f62b86b31eb2b97b5
Author: Adrien Bustany <abustany gnome org>
Date:   Thu Jun 10 12:36:59 2010 -0400

    Steroids tests: Check number of returned rows

 tests/tracker-steroids/tracker-test.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tests/tracker-steroids/tracker-test.c b/tests/tracker-steroids/tracker-test.c
index 42b1e3a..da2b354 100644
--- a/tests/tracker-steroids/tracker-test.c
+++ b/tests/tracker-steroids/tracker-test.c
@@ -165,6 +165,7 @@ test_tracker_sparql_query_iterate ()
 	GError *error = NULL;
 	const gchar *query = "SELECT ?r nie:url(?r) WHERE {?r a nfo:FileDataObject}";
 	guint i = 0;
+	int n_rows = 0;
 
 	r1 = tracker_resources_sparql_query (client, query, &error);
 
@@ -179,12 +180,16 @@ test_tracker_sparql_query_iterate ()
 
 		g_assert (i < r1->len);
 
+		n_rows ++;
+
 		tracker_result_iterator_next (iterator);
 		row = g_ptr_array_index (r1, i++);
 
 		g_assert (!g_strcmp0 (tracker_result_iterator_value (iterator, 0), row[0]));
 	}
 
+	g_assert (n_rows == r1->len);
+
 	tracker_result_iterator_free (iterator);
 	tracker_dbus_results_ptr_array_free (&r1);
 }
@@ -199,6 +204,7 @@ test_tracker_sparql_query_iterate_largerow ()
 	GError *error = NULL;
 	const gchar *query = "SELECT nao:identifier(?r) WHERE {?r a nmm:Photo}";
 	guint i = 0;
+	int n_rows = 0;
 
 	r1 = tracker_resources_sparql_query (client, query, &error);
 
@@ -213,12 +219,16 @@ test_tracker_sparql_query_iterate_largerow ()
 
 		g_assert (i < r1->len);
 
+		n_rows ++;
+
 		tracker_result_iterator_next (iterator);
 		row = g_ptr_array_index (r1, i++);
 
 		g_assert (!g_strcmp0 (tracker_result_iterator_value (iterator, 0), row[0]));
 	}
 
+	g_assert (n_rows == r1->len);
+
 	tracker_result_iterator_free (iterator);
 	tracker_dbus_results_ptr_array_free (&r1);
 }



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