summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-04-07 11:02:51 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-04-07 11:02:51 +0000
commit3a8bdd99cbc55bc9e275ea9b74920926d782b1f9 (patch)
tree67e8c26b7cb1d7d95825c7226845c70b275f8d91
parentca2dae426e0f7fc55d81fc29422f24d47a193e35 (diff)
Notes
-rw-r--r--tools/regression/lib/libc/locale/test-mblen.c5
-rw-r--r--tools/regression/lib/libc/locale/test-mbtowc.c5
-rw-r--r--tools/regression/lib/libc/locale/test-wctomb.c3
3 files changed, 10 insertions, 3 deletions
diff --git a/tools/regression/lib/libc/locale/test-mblen.c b/tools/regression/lib/libc/locale/test-mblen.c
index 9975e3d1bc0d..236cbc7ed1c0 100644
--- a/tools/regression/lib/libc/locale/test-mblen.c
+++ b/tools/regression/lib/libc/locale/test-mblen.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002 Tim J. Robbins
+ * Copyright (c) 2002-2004 Tim J. Robbins
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,6 +69,7 @@ main(int argc, char *argv[])
/* Incomplete character sequence. */
buf[0] = '\0';
assert(mblen(buf, 0) == -1);
+ assert(mblen(NULL, 0) == 0);
/*
* Japanese (EUC) locale.
@@ -92,12 +93,14 @@ main(int argc, char *argv[])
/* Incomplete character sequence. */
buf[0] = '\0';
assert(mblen(buf, 0) == -1);
+ assert(mblen(NULL, 0) == 0);
/* Incomplete character sequence (truncated double-byte). */
memset(buf, 0xcc, sizeof(buf));
buf[0] = 0xa3;
buf[1] = 0x00;
assert(mblen(buf, 1) == -1);
+ assert(mblen(NULL, 0) == 0);
/* Same as above, but complete. */
buf[1] = 0xc1;
diff --git a/tools/regression/lib/libc/locale/test-mbtowc.c b/tools/regression/lib/libc/locale/test-mbtowc.c
index e38086e2161b..a58d261eff57 100644
--- a/tools/regression/lib/libc/locale/test-mbtowc.c
+++ b/tools/regression/lib/libc/locale/test-mbtowc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002 Tim J. Robbins
+ * Copyright (c) 2002-2004 Tim J. Robbins
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -74,6 +74,7 @@ main(int argc, char *argv[])
buf[0] = '\0';
assert(mbtowc(&wc, buf, 0) == -1);
assert(wc == L'z');
+ assert(mbtowc(NULL, NULL, 0) == 0);
/*
* Japanese (EUC) locale.
@@ -99,6 +100,7 @@ main(int argc, char *argv[])
buf[0] = '\0';
assert(mbtowc(&wc, buf, 0) == -1);
assert(wc == L'z');
+ assert(mbtowc(NULL, NULL, 0) == 0);
/* Incomplete character sequence (truncated double-byte). */
memset(buf, 0xcc, sizeof(buf));
@@ -107,6 +109,7 @@ main(int argc, char *argv[])
wc = L'z';
assert(mbtowc(&wc, buf, 1) == -1);
assert(wc == L'z');
+ assert(mbtowc(NULL, NULL, 0) == 0);
/* Same as above, but complete. */
buf[1] = 0xc1;
diff --git a/tools/regression/lib/libc/locale/test-wctomb.c b/tools/regression/lib/libc/locale/test-wctomb.c
index d517944a5500..8227f90987b8 100644
--- a/tools/regression/lib/libc/locale/test-wctomb.c
+++ b/tools/regression/lib/libc/locale/test-wctomb.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002 Tim J. Robbins
+ * Copyright (c) 2002-2004 Tim J. Robbins
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,7 @@ main(int argc, char *argv[])
/* Invalid code. */
assert(wctomb(buf, UCHAR_MAX + 1) == -1);
+ assert(wctomb(NULL, 0) == 0);
/*
* Japanese (EUC) locale.