[tracker/dbus-fd-experiment] Add tests for tracker_resources_sparql_update_fast



commit 51397ad2f70e2c2f2cad911bd2b752cc2bdecddc
Author: Adrien Bustany <abustany gnome org>
Date:   Wed Jun 2 09:46:49 2010 -0400

    Add tests for tracker_resources_sparql_update_fast

 tests/tracker-steroids/tracker-test.c |   52 +++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/tests/tracker-steroids/tracker-test.c b/tests/tracker-steroids/tracker-test.c
index 2a4592c..a0f0136 100644
--- a/tests/tracker-steroids/tracker-test.c
+++ b/tests/tracker-steroids/tracker-test.c
@@ -188,6 +188,55 @@ test_tracker_sparql_query_iterate_sigpipe ()
 	return;
 }
 
+static void
+test_tracker_sparql_update_fast_small ()
+{
+	GError *error = NULL;
+	const gchar *query = "INSERT { _:x a nmo:Message }";
+
+	tracker_resources_sparql_update_fast (client, query, &error);
+
+	g_assert (!error);
+
+	return;
+}
+
+static void
+test_tracker_sparql_update_fast_large ()
+{
+	GError *error = NULL;
+	const gchar *query_template = "INSERT { _:x a nmo:Message; nao:identifier \"%s\" }";
+	gchar *lotsOfA;
+	gchar *query;
+
+	lotsOfA = g_malloc (LONG_NAME_SIZE);
+	memset (lotsOfA, 'a', LONG_NAME_SIZE);
+
+	query = g_strdup_printf (query_template, lotsOfA);
+
+	tracker_resources_sparql_update_fast (client, query, &error);
+
+	g_free (lotsOfA);
+	g_free (query);
+
+	g_assert (!error);
+
+	return;
+}
+
+static void
+test_tracker_sparql_update_fast_error ()
+{
+	GError *error = NULL;
+	const gchar *query = "blork blork blork";
+
+	tracker_resources_sparql_update_fast (client, query, &error);
+
+	g_assert (error);
+
+	return;
+}
+
 gint
 main (gint argc, gchar **argv)
 {
@@ -203,6 +252,9 @@ main (gint argc, gchar **argv)
         g_test_add_func ("/steroids/tracker/tracker_sparql_query_iterate_error", test_tracker_sparql_query_iterate_error);
         g_test_add_func ("/steroids/tracker/tracker_sparql_query_iterate_empty", test_tracker_sparql_query_iterate_empty);
         g_test_add_func ("/steroids/tracker/tracker_sparql_query_iterate_sigpipe", test_tracker_sparql_query_iterate_sigpipe);
+        g_test_add_func ("/steroids/tracker/tracker_sparql_update_fast_small", test_tracker_sparql_update_fast_small);
+        g_test_add_func ("/steroids/tracker/tracker_sparql_update_fast_large", test_tracker_sparql_update_fast_large);
+        g_test_add_func ("/steroids/tracker/tracker_sparql_update_fast_error", test_tracker_sparql_update_fast_error);
 
 		// client is leaked
 



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