From 805b4fdf7b70b0e9b298064f24ceff0c1d38e05b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 5 Oct 2013 16:28:12 +0200 Subject: [PATCH] Add check for GDU type --- src/Makefile.am | 3 ++- src/test_gdu.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/test_gdu.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 2d3621a..fca2afc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 index 0000000..31319d9 --- /dev/null +++ b/src/test_gdu.cpp @@ -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 +#endif +#include +#include +#include +#include + +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 + */ + -- 1.7.10.4