Add check for GDU type
authorAdam Dickmeiss <adam@indexdata.dk>
Sat, 5 Oct 2013 14:28:12 +0000 (16:28 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Sat, 5 Oct 2013 14:28:12 +0000 (16:28 +0200)
src/Makefile.am
src/test_gdu.cpp [new file with mode: 0644]

index 2d3621a..fca2afc 100644 (file)
@@ -1,5 +1,5 @@
 
-check_PROGRAMS = test_query
+check_PROGRAMS = test_query test_gdu
 noinst_PROGRAMS = yaz-my-server yaz-my-client
 bin_SCRIPTS = yazpp-config
 
@@ -28,5 +28,6 @@ yaz_my_client_SOURCES=yaz-my-client.cpp
 yaz_my_server_SOURCES=yaz-my-server.cpp yaz-marc-sample.cpp
 
 test_query_SOURCES=test_query.cpp
+test_gdu_SOURCES=test_gdu.cpp
 
 LDADD=libyazpp.la $(YAZLALIB)
diff --git a/src/test_gdu.cpp b/src/test_gdu.cpp
new file mode 100644 (file)
index 0000000..31319d9
--- /dev/null
@@ -0,0 +1,49 @@
+/* This file is part of the yazpp toolkit.
+ * Copyright (C) 1998-2013 Index Data and Mike Taylor
+ * See the file LICENSE for details.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdlib.h>
+#include <yazpp/gdu.h>
+#include <yaz/test.h>
+#include <yaz/log.h>
+
+using namespace yazpp_1;
+
+static void tst1(void)
+{
+    ODR odr = odr_createmem(ODR_ENCODE);
+
+    const char *url =
+        "http://localhost:9036/XXX/cproxydebug-7/node102/p/105/c=content_connector"
+        "a=usr/pw#&? r=cfusr/cfpw p=1.2.3.4:80/www.indexdata.com/staff/";
+    int use_full_host = 0;
+    Z_GDU *gdu_req = z_get_HTTP_Request_uri(odr, url, 0, use_full_host);
+
+    GDU a(gdu_req);
+    GDU b;
+
+    b = a;
+
+    odr_destroy(odr);
+}
+
+int main(int argc, char **argv)
+{
+    YAZ_CHECK_INIT(argc, argv);
+    tst1();
+    YAZ_CHECK_TERM;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+