#ifndef lint
#endif
/*
* Copyright (c) 2002 Japan Network Information Center.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set forth bellow.
*
* LICENSE TERMS AND CONDITIONS
*
* The following License Terms and Conditions apply, unless a different
* license is obtained from Japan Network Information Center ("JPNIC"),
* a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
* Chiyoda-ku, Tokyo 101-0047, Japan.
*
* 1. Use, Modification and Redistribution (including distribution of any
* under this License Terms and Conditions.
*
* 2. Redistribution of source code must retain the copyright notices as they
* appear in each source code file, this License Terms and Conditions.
*
* 3. Redistribution in binary form must reproduce the Copyright Notice,
* materials provided with the distribution. For the purposes of binary
* distribution the "Copyright Notice" refers to the following language:
* "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."
*
* 4. The name of JPNIC may not be used to endorse or promote products
* derived from this Software without specific prior written approval of
* JPNIC.
*
* 5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <testsuite.h>
struct idn_testcase {
char *title;
};
struct idn_testsuite {
int ntestcases;
int testcase_size;
int npassed;
int nfailed;
int nskipped;
int verbose;
};
static char *make_hex_string(const char *string);
static char *make_hex_ucs4string(const unsigned long *string);
static void idn_testsuite_msgtostderr(const char *msg);
int
goto error;
ctx->ntestcases = 0;
ctx->testcase_size = 0;
goto error;
return (1);
return (0);
}
void
int i;
for (i = 0; i < ctx->ntestcases; i++)
}
int
int new_size;
goto error;
sizeof(struct idn_testcase) * new_size);
if (new_buffer == NULL)
goto error;
}
ctx->ntestcases++;
return (1);
return (0);
}
int
return (ctx->ntestcases);
}
void
}
void
}
static void
int i, j;
int run_testcase;
const char *status;
for (i = 0; i < ctx->ntestcases; i++) {
run_testcase = 1;
else {
run_testcase = 0;
titles[j]) == 0) {
run_testcase = 1;
break;
}
}
}
if (!run_testcase) {
continue;
}
}
status);
}
switch (ctx->current_status) {
case idn_teststatus_pass:
break;
case idn_teststatus_fail:
break;
case idn_teststatus_skip:
break;
}
}
}
void
}
void
}
int
}
int
}
int
}
return (ctx->current_status);
}
void
status == idn_teststatus_fail ||
}
const char *
status == idn_teststatus_fail ||
switch (status) {
case idn_teststatus_pass:
return "pass";
break;
case idn_teststatus_fail:
return "failed";
break;
case idn_teststatus_skip:
return "skipped";
break;
}
return "unknown";
}
void
return;
}
void
return;
return;
}
void
char *msg;
return;
return;
msg = "";
} else {
}
}
void
char *msg;
return;
return;
msg = "NULL expected, but got non-NULL";
msg = "non-NULL expected, but got NULL";
else
msg = "expected pointer != gotten pointer";
}
void
const void *gotten, const void *unexpected,
char *msg;
return;
if (unexpected != gotten)
return;
if (unexpected == NULL)
msg = "non-NULL unexpected, but got NULL";
msg = "non-NULL expected, but got NULL";
else
msg = "expected pointer == gotten pointer";
}
void
return;
return;
}
void
const unsigned long *gotten,
const unsigned long *expected,
char *msg;
return;
return;
msg = "";
} else {
}
}
static char *
char *hex_string;
const char *src;
char *dst;
if (hex_string == NULL)
return NULL;
} else {
*dst++ = '\\';
*dst++ = 'x';
}
}
*dst = '\0';
return hex_string;
}
static char *
char *hex_string;
const unsigned long *src;
char *dst;
if (hex_string == NULL)
return NULL;
*dst++ = '\\';
*dst++ = 'u';
if (*src >= 0x100000) {
}
if (*src >= 0x10000) {
}
} else {
*dst++ = '\\';
*dst++ = 'u';
*dst++ = '?';
*dst++ = '?';
*dst++ = '?';
*dst++ = '?';
}
}
*dst = '\0';
return hex_string;
}
static void
int lineno) {
const char *title;
}
static void
}