aboutsummaryrefslogtreecommitdiff
path: root/dbfp_check.c
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2016-03-10 16:18:19 +0100
committerRobin Krahl <me@robin-krahl.de>2016-03-10 16:18:19 +0100
commit4d9a2fba4987cd27b07db426fea921efcf8c9fc3 (patch)
treed7e0580ff8db63221a537c6d9e4c9834b3755b4c /dbfp_check.c
parent913fc9d2c2935e0faf34657747286ce83af21853 (diff)
downloaddbfp-4d9a2fba4987cd27b07db426fea921efcf8c9fc3.tar.gz
dbfp-4d9a2fba4987cd27b07db426fea921efcf8c9fc3.tar.bz2
dbfp: add lon and lat to dbfp_location and to the query
The location.name query (dbfp_query_location_name) also returns the coordinates of the location. This commit adds them to the dbfp_location structure and to the query itself.
Diffstat (limited to 'dbfp_check.c')
-rw-r--r--dbfp_check.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dbfp_check.c b/dbfp_check.c
index 2c048d8..5e8e225 100644
--- a/dbfp_check.c
+++ b/dbfp_check.c
@@ -48,6 +48,7 @@ START_TEST(test_dbfp_location_simple)
struct dbfp dbfp;
struct dbfp_location *locations = NULL;
size_t n;
+ size_t i;
err = dbfp_init(&dbfp, api_key);
ck_assert_int_eq(err, 0);
@@ -60,7 +61,13 @@ START_TEST(test_dbfp_location_simple)
ck_assert_str_eq(locations[0].name, "Freiburg(Breisgau) Hbf");
ck_assert_str_eq(locations[0].id, "008000107");
+ ck_assert(locations[0].lon == 7.841173f);
+ ck_assert(locations[0].lat == 47.997696f);
+ for (i = 0; i < n; i++) {
+ free(locations[i].name);
+ free(locations[i].id);
+ }
free(locations);
dbfp_close(&dbfp);
}