From 02f3d1f52b8c279f826ccda2d2cccb6ff7ec65cb Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos
Date: Sat, 28 Mar 2015 13:27:47 +0100 Subject: [PATCH 2/2] Added a check for invalid encodings --- tests/Makefile.am | 2 +- tests/tst_invalid.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/tst_invalid.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 0f491ec..acb50b3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -27,7 +27,7 @@ libutils_a_SOURCES = utils.h utils.c ctests = tst_stringprep tst_punycode tst_idna tst_idna2 tst_idna3 \ tst_idna4 tst_nfkc tst_pr29 tst_strerror tst_toutf8 \ - tst_symbols + tst_symbols tst_invalid if TLD ctests += tst_tld endif diff --git a/tests/tst_invalid.c b/tests/tst_invalid.c new file mode 100644 index 0000000..32285a5 --- /dev/null +++ b/tests/tst_invalid.c @@ -0,0 +1,52 @@ +/* tst_idna.c --- Self tests for idna_to_ascii(). + * Copyright (C) 2015 Nikos Mavrogiannopoulos + * + * This file is part of GNU Libidn. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see