[geocode-glib] test: Add test for geocode_object_get_coords()



commit 88adb02f77715e1060a6f63114826cf02eb58c7b
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 5 13:21:51 2011 +0100

    test: Add test for geocode_object_get_coords()

 geocode-glib/test-gcglib.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/geocode-glib/test-gcglib.c b/geocode-glib/test-gcglib.c
index f232464..4f711ca 100644
--- a/geocode-glib/test-gcglib.c
+++ b/geocode-glib/test-gcglib.c
@@ -124,6 +124,7 @@ test_pub (void)
 	GeocodeObject *object;
 	GError *error = NULL;
 	GHashTable *ht;
+	gdouble longitude, latitude;
 
 	object = geocode_object_new ();
 	geocode_object_add (object, "location", "9, old palace road, guildford, surrey");
@@ -137,6 +138,9 @@ test_pub (void)
 	g_object_unref (object);
 	g_assert (g_strcmp0 (g_hash_table_lookup (ht, "longitude"), "-0.589669") == 0);
 	g_assert (g_strcmp0 (g_hash_table_lookup (ht, "latitude"), "51.237070") == 0);
+	g_assert (geocode_object_get_coords (ht, &longitude, &latitude) != FALSE);
+	g_assert (longitude == -0.589669);
+	g_assert (latitude == 51.237070);
 
 	g_print ("Got geocode answer:\n");
 	g_hash_table_foreach (ht, (GHFunc) print_res, NULL);



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