[tracker/return-types: 16/18] functional-test: Added the value-type to the test



commit 0d330807be03274a990a9eefe9ad8e18f7a2d6ee
Author: Philip Van Hoof <philip codeminded be>
Date:   Fri Sep 10 15:58:00 2010 +0200

    functional-test: Added the value-type to the test

 tests/functional-tests/shared-query-test.vala |   26 ++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/tests/functional-tests/shared-query-test.vala b/tests/functional-tests/shared-query-test.vala
index 3fc3ea5..267f3fd 100644
--- a/tests/functional-tests/shared-query-test.vala
+++ b/tests/functional-tests/shared-query-test.vala
@@ -10,6 +10,28 @@ public class TestApp : GLib.Object {
 		con = connection;
 	}
 
+	string type_to_string (Sparql.ValueType type) {
+		switch (type) {
+			case Sparql.ValueType.UNBOUND:
+				return "unbound";
+			case Sparql.ValueType.URI:
+				return "uri";
+			case Sparql.ValueType.STRING:
+				return "string";
+			case Sparql.ValueType.INTEGER:
+				return "integer";
+			case Sparql.ValueType.DOUBLE:
+				return "double";
+			case Sparql.ValueType.DATETIME:
+				return "datetime";
+			case Sparql.ValueType.BLANK_NODE:
+				return "blank-node";
+			default:
+				break;
+		}
+		return "unknown";
+	}
+
 	int iter_cursor (Cursor cursor) {
 		int i;
 
@@ -22,7 +44,9 @@ public class TestApp : GLib.Object {
 			while (cursor.next()) {
 
 				for (i = 0; i < cursor.n_columns; i++) {
-					print ("%s%s", i != 0 ? ",":"", cursor.get_string (i));
+					print ("%s%s a %s", i != 0 ? ",":"",
+					       cursor.get_string (i),
+					       type_to_string (cursor.get_value_type (i)));
 				}
 
 				print ("\n");



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