From: Adam Dickmeiss Date: Mon, 4 Jun 2012 13:01:06 +0000 (+0200) Subject: Beginnings of test_embed_record X-Git-Tag: v4.2.34~5 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=29410c87550c87533c019efeddb83d527a44ce64;p=yaz-moved-to-github.git Beginnings of test_embed_record --- diff --git a/test/.gitignore b/test/.gitignore index 97fdae2..43f14b5 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -6,6 +6,7 @@ test_odrcodec.h .libs test_cql2ccl test_ccl +test_embed_record test_iconv test_matchstr test_nmem diff --git a/test/Makefile.am b/test/Makefile.am index 32a14ba..2339409 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2,7 +2,7 @@ ## Copyright (C) 1995-2012 Index Data check_PROGRAMS = test_ccl test_comstack test_cql2ccl \ - test_filepath test_file_glob \ + test_embed_record test_filepath test_file_glob \ test_iconv test_icu test_json \ test_libstemmer test_log test_log_thread \ test_match_glob test_matchstr test_mutex \ @@ -97,3 +97,4 @@ test_xml_include_SOURCES = test_xml_include.c test_file_glob_SOURCES = test_file_glob.c test_shared_ptr_SOURCES = test_shared_ptr.c test_libstemmer_SOURCES = test_libstemmer.c +test_embed_record_SOURCES = test_embed_record.c diff --git a/test/test_embed_record.c b/test/test_embed_record.c new file mode 100644 index 0000000..52d591f --- /dev/null +++ b/test/test_embed_record.c @@ -0,0 +1,50 @@ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2012 Index Data + * See the file LICENSE for details. + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#if YAZ_HAVE_XML2 + +#include + +#include +#include + +void test(void) +{ + char sample_rec[] = "MTIzNAo="; + char out_rec[10]; + yaz_base64decode(sample_rec, out_rec); + YAZ_CHECK(strcmp(out_rec, "1234\n") == 0); +} +#endif + +int main(int argc, char **argv) +{ + YAZ_CHECK_INIT(argc, argv); + YAZ_CHECK_LOG(); +#if YAZ_HAVE_XML2 + test(); +#endif + YAZ_CHECK_TERM; +} + + +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +