aboutsummaryrefslogtreecommitdiff
path: root/libplanfahr
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-03-09 18:27:02 +0100
committerGuido Günther <agx@sigxcpu.org>2014-03-18 21:33:30 +0100
commit81eb564eabd741547afb0f1ff0066ef8a898844d (patch)
tree5d4e7865c32a536419a14b7a6db04304e17a80c3 /libplanfahr
parent207370ba70f20b4f40ff155ea9dcdcac96cb4153 (diff)
Cope with older glib
like 2.32 in Debian Wheezy
Diffstat (limited to 'libplanfahr')
-rw-r--r--libplanfahr/providers/tests/hafas-bin6-format.c2
-rw-r--r--libplanfahr/providers/tests/hafas-bin6.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/libplanfahr/providers/tests/hafas-bin6-format.c b/libplanfahr/providers/tests/hafas-bin6-format.c
index ea5e277..9b68e47 100644
--- a/libplanfahr/providers/tests/hafas-bin6-format.c
+++ b/libplanfahr/providers/tests/hafas-bin6-format.c
@@ -77,7 +77,7 @@ test_parse_erpel_unkel(void)
{1059, 0 }};
guint expected_stops[3][2] = { {0, 0}, {0, 8}, {0, 0} };
- g_assert_true(g_file_get_contents(LPF_TEST_SRCDIR "/hafas-bin-6-station-query-1.bin", &bin, &length, NULL));
+ g_assert(g_file_get_contents(LPF_TEST_SRCDIR "/hafas-bin-6-station-query-1.bin", &bin, &length, NULL) == TRUE);
g_assert_cmpint(HAFAS_BIN6_HEADER(bin)->num_trips, ==, 3);
diff --git a/libplanfahr/providers/tests/hafas-bin6.c b/libplanfahr/providers/tests/hafas-bin6.c
index 8c256e0..141d1fe 100644
--- a/libplanfahr/providers/tests/hafas-bin6.c
+++ b/libplanfahr/providers/tests/hafas-bin6.c
@@ -46,7 +46,11 @@ test_parse_locs (void)
"</ResC>", NULL);
locs = parse_locs_xml(xml);
+#if GLIB_CHECK_VERSION (2, 40, 0)
g_assert_nonnull (locs);
+#else
+ g_assert (locs != NULL);
+#endif
g_assert_cmpint (g_slist_length (locs), ==, 7);
loc = g_slist_nth (locs, 4)->data;
@@ -76,7 +80,11 @@ test_parse_trips (void)
gchar *name;
GDateTime *dep, *arr;
+#if GLIB_CHECK_VERSION (2, 38, 0)
g_assert_true(g_file_get_contents(LPF_TEST_SRCDIR "/hafas-bin-6-station-query-1.bin", &binary, &length, NULL));
+#else
+ g_assert(g_file_get_contents(LPF_TEST_SRCDIR "/hafas-bin-6-station-query-1.bin", &binary, &length, NULL) == TRUE);
+#endif
trips = hafas_binary_parse_trips (binary, length);
@@ -127,6 +135,9 @@ test_parse_trips (void)
int main(int argc, char **argv)
{
gboolean ret;
+#if ! GLIB_CHECK_VERSION(2, 36, 0)
+ g_type_init ();
+#endif
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/providers/de-db/parse_stations", test_parse_locs);