]> git.street.me.uk Git - andy/viking.git/blobdiff - test/test_vikgotoxmltool.c
Fix heap-buffer-overflow on Layers -> New GPS Layer
[andy/viking.git] / test / test_vikgotoxmltool.c
index ab0503577742cd3ef56bfc9da0cb96c5c73faff3..d48233fee3ef7ed57c21cbaf9c6efe52d19e1280 100644 (file)
@@ -14,8 +14,10 @@ void parse(VikGotoTool *tool, gchar *filename)
 
 int main(int argc, char *argv[])
 {
+#if !GLIB_CHECK_VERSION (2, 36, 0)
   g_type_init();
-  
+#endif
+
   VikGotoXmlTool *with_element = VIK_GOTO_XML_TOOL ( g_object_new ( VIK_GOTO_XML_TOOL_TYPE, "label", "OSM",
     "url-format", "http://ws.geonames.org/search?q=%s&maxRows=1&lang=es&style=short",
     "lat-path", "/geonames/geoname/lat",
@@ -39,8 +41,9 @@ int main(int argc, char *argv[])
   int i;
   for (i = 1; i<argc ; i++)
   {
-    parse(with_element, argv[i]);
-    parse(with_attr, argv[i]);
-    parse(with_xpath, argv[i]);
+    parse(VIK_GOTO_TOOL(with_element), argv[i]);
+    parse(VIK_GOTO_TOOL(with_attr), argv[i]);
+    parse(VIK_GOTO_TOOL(with_xpath), argv[i]);
   }
+  return 0;
 }