[tracker/dbus-fd-experiment: 8/15] Add tests for tracker_resources_sparql_update_fast
- From: Adrien Bustany <abustany src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/dbus-fd-experiment: 8/15] Add tests for tracker_resources_sparql_update_fast
- Date: Thu, 3 Jun 2010 17:02:49 +0000 (UTC)
commit 8a4679e757823f673abf7371efc93eb53550fa05
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 35a4d54..66250b4 100644
--- a/tests/tracker-steroids/tracker-test.c
+++ b/tests/tracker-steroids/tracker-test.c
@@ -184,6 +184,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)
{
@@ -199,6 +248,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]