X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftsticonv.c;h=feb88685eb1e5026801145a3f2d9c1d6af92e876;hb=c5a81c4eb35bcab571d42f4e02a69e4ed76dc20b;hp=20424d622b0a51ddbafb2d37e077d838bb1b1e88;hpb=5fa800e6ead7ceef916094cac7e9b7df71a3b324;p=yaz-moved-to-github.git diff --git a/test/tsticonv.c b/test/tsticonv.c index 20424d6..feb8868 100644 --- a/test/tsticonv.c +++ b/test/tsticonv.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ @@ -681,6 +681,27 @@ static void tst_utf8_codes(void) YAZ_CHECK(utf8_check(100000000)); } +static void tst_danmarc_to_latin1(void) +{ + yaz_iconv_t cd = yaz_iconv_open("iso-8859-1", "danmarc"); + + YAZ_CHECK(cd); + if (!cd) + return; + + YAZ_CHECK(tst_convert(cd, "ax", "ax")); + + YAZ_CHECK(tst_convert(cd, "a@@b", "a@b")); + YAZ_CHECK(tst_convert(cd, "a@@@@b", "a@@b")); + YAZ_CHECK(tst_convert(cd, "@000ab", "\nb")); + + YAZ_CHECK(tst_convert(cd, "@\xe5", "aa")); + YAZ_CHECK(tst_convert(cd, "@\xc5.", "Aa.")); + + yaz_iconv_close(cd); +} + + int main (int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); @@ -700,6 +721,8 @@ int main (int argc, char **argv) tst_utf8_to_marc8("marc8lossy"); tst_utf8_to_marc8("marc8lossless"); + tst_danmarc_to_latin1(); + tst_latin1_to_marc8(); tst_marc8_to_ucs4b(); @@ -716,7 +739,9 @@ int main (int argc, char **argv) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +