[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS libidn/tests
From: |
libidn-commit |
Subject: |
CVS libidn/tests |
Date: |
Sat, 02 Oct 2004 19:26:41 +0200 |
Update of /home/cvs/libidn/tests
In directory dopio:/tmp/cvs-serv2114
Modified Files:
Makefile.am
Added Files:
tst_strerror.c
Log Message:
Add.
--- /home/cvs/libidn/tests/Makefile.am 2004/09/26 07:04:34 1.14
+++ /home/cvs/libidn/tests/Makefile.am 2004/10/02 17:26:40 1.15
@@ -25,6 +25,7 @@
libutils_la_SOURCES = utils.h utils.c
TESTS = tst_stringprep tst_punycode tst_idna tst_idna2 tst_nfkc tst_pr29
+TESTS += tst_strerror
if TLD
TESTS += tst_tld
endif
--- /home/cvs/libidn/tests/tst_strerror.c 2004/10/02 17:26:41 NONE
+++ /home/cvs/libidn/tests/tst_strerror.c 2004/10/02 17:26:41 1.1
/* tst_strerror.c --- Self tests for *_strerror().
* Copyright (C) 2004 Simon Josefsson.
*
* This file is part of GNU Libidn.
*
* GNU Libidn 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 2 of the License, or
* (at your option) any later version.
*
* GNU Libidn 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 GNU Libidn; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <idna.h>
#include <pr29.h>
#include <punycode.h>
#include <stringprep.h>
#include <tld.h>
#include "utils.h"
#define SUCCESS "Success"
#define UNKNOWN "Unknown error"
void
doit (void)
{
const char *p;
/* Test success. */
p = idna_strerror (0);
if (strcmp (p, SUCCESS) != 0)
fail ("idna_strerror (0) failed: %s\n", p);
if (debug)
printf ("idna_strerror (0) OK\n");
p = pr29_strerror (0);
if (strcmp (p, SUCCESS) != 0)
fail ("pr29_strerror (0) failed: %s\n", p);
if (debug)
printf ("pr29_strerror (0) OK\n");
p = punycode_strerror (0);
if (strcmp (p, SUCCESS) != 0)
fail ("punycode_strerror (0) failed: %s\n", p);
if (debug)
printf ("punycode_strerror (0) OK\n");
p = stringprep_strerror (0);
if (strcmp (p, SUCCESS) != 0)
fail ("stringprep_strerror (0) failed: %s\n", p);
if (debug)
printf ("stringprep_strerror (0) OK\n");
p = tld_strerror (0);
if (strcmp (p, SUCCESS) != 0)
fail ("tld_strerror (0) failed: %s\n", p);
if (debug)
printf ("tld_strerror (0) OK\n");
/* Test unknown error. */
p = idna_strerror (42);
if (strcmp (p, UNKNOWN) != 0)
fail ("idna_strerror (42) failed: %s\n", p);
if (debug)
printf ("idna_strerror (42) OK\n");
p = pr29_strerror (42);
if (strcmp (p, UNKNOWN) != 0)
fail ("pr29_strerror (42) failed: %s\n", p);
if (debug)
printf ("pr29_strerror (42) OK\n");
p = punycode_strerror (42);
if (strcmp (p, UNKNOWN) != 0)
fail ("punycode_strerror (42) failed: %s\n", p);
if (debug)
printf ("punycode_strerror (42) OK\n");
p = stringprep_strerror (42);
if (strcmp (p, UNKNOWN) != 0)
fail ("stringprep_strerror (42) failed: %s\n", p);
if (debug)
printf ("stringprep_strerror (42) OK\n");
p = tld_strerror (42);
if (strcmp (p, UNKNOWN) != 0)
fail ("tld_strerror (42) failed: %s\n", p);
if (debug)
printf ("tld_strerror (42) OK\n");
}