summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2014-10-24 18:12:08 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2014-10-24 18:12:08 +0000
commit84b24719b6c8ba29fd42ec2e2efb8029157add82 (patch)
tree352137a411d327b543f66d63258d1fcd43f5ed25
parent0deafb5e59652c7ad0a07547829b43a88fac1807 (diff)
parent81cc999477f2f5f0896ee349f6ec8fc2f804ece3 (diff)
downloadillumos-joyent-84b24719b6c8ba29fd42ec2e2efb8029157add82.tar.gz
[illumos-gate merge]
commit 81cc999477f2f5f0896ee349f6ec8fc2f804ece3 5238 iswgraph(L'a') returns 0, but iswctype(L'a', wctype("graph")) nonzero commit c375047346b15ac13f787bc562bb7e724c97baf5 4213 Missing spaces in man pages Manifests: usr/src/pkg/manifests/system-test-libctest.mf (ignore)
-rw-r--r--usr/src/lib/libc/port/locale/iswctype.c2
-rw-r--r--usr/src/man/man1/diff3.19
-rw-r--r--usr/src/man/man3c/enable_extended_FILE_stdio.3c5
-rw-r--r--usr/src/man/man3c/mutex_init.3c11
-rw-r--r--usr/src/man/man3nsl/rpc_control.3nsl5
-rw-r--r--usr/src/man/man3nsl/t_rcvudata.3nsl5
-rw-r--r--usr/src/man/man3nsl/xdr_simple.3nsl5
-rw-r--r--usr/src/man/man5/kerberos.55
-rw-r--r--usr/src/man/man9f/kmem_alloc.9f5
-rw-r--r--usr/src/pkg/manifests/system-test-libctest.mf5
-rw-r--r--usr/src/test/libc-tests/runfiles/default.run2
-rw-r--r--usr/src/test/libc-tests/tests/Makefile2
-rw-r--r--usr/src/test/libc-tests/tests/wctype/Makefile21
-rw-r--r--usr/src/test/libc-tests/tests/wctype/wctype_test.c85
14 files changed, 144 insertions, 23 deletions
diff --git a/usr/src/lib/libc/port/locale/iswctype.c b/usr/src/lib/libc/port/locale/iswctype.c
index 1698113ace..25d3c6dc34 100644
--- a/usr/src/lib/libc/port/locale/iswctype.c
+++ b/usr/src/lib/libc/port/locale/iswctype.c
@@ -138,7 +138,7 @@ DEFN_ISWTYPE(alpha, _CTYPE_A)
DEFN_ISWTYPE(blank, _CTYPE_B)
DEFN_ISWTYPE(cntrl, _CTYPE_C)
DEFN_ISWTYPE(digit, _CTYPE_D)
-DEFN_ISWTYPE(graph, _CTYPE_D)
+DEFN_ISWTYPE(graph, _CTYPE_G)
DEFN_ISWTYPE(lower, _CTYPE_L)
DEFN_ISWTYPE(upper, _CTYPE_U)
DEFN_ISWTYPE(print, _CTYPE_R)
diff --git a/usr/src/man/man1/diff3.1 b/usr/src/man/man1/diff3.1
index 001761ac6b..46b1b7ae2a 100644
--- a/usr/src/man/man1/diff3.1
+++ b/usr/src/man/man1/diff3.1
@@ -1,9 +1,10 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright 1989 AT&T Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DIFF3 1 "Nov 7, 2005"
+.TH DIFF3 1 "Oct 22, 2014"
.SH NAME
diff3 \- 3-way differential file comparison
.SH SYNOPSIS
@@ -32,7 +33,7 @@ all three files differ
\fB\fB====1\fR\fR
.ad
.RS 9n
-\fIfilename1\fRis different
+\fIfilename1\fR is different
.RE
.sp
@@ -41,7 +42,7 @@ all three files differ
\fB\fB====2\fR\fR
.ad
.RS 9n
-\fIfilename2\fRis different
+\fIfilename2\fR is different
.RE
.sp
@@ -50,7 +51,7 @@ all three files differ
\fB\fB====3\fR\fR
.ad
.RS 9n
-\fIfilename3\fRis different
+\fIfilename3\fR is different
.RE
.sp
diff --git a/usr/src/man/man3c/enable_extended_FILE_stdio.3c b/usr/src/man/man3c/enable_extended_FILE_stdio.3c
index 8d43af859d..08c3a2141d 100644
--- a/usr/src/man/man3c/enable_extended_FILE_stdio.3c
+++ b/usr/src/man/man3c/enable_extended_FILE_stdio.3c
@@ -1,9 +1,10 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH ENABLE_EXTENDED_FILE_STDIO 3C "Apr 18, 2006"
+.TH ENABLE_EXTENDED_FILE_STDIO 3C "Oct 22, 2014"
.SH NAME
enable_extended_FILE_stdio \- enable extended FILE facility within standard I/O
.SH SYNOPSIS
@@ -278,7 +279,7 @@ even higher if \fImyfd\fR has a value greater than 255 and is truncated by the
assignment to the 8-bit \fI_file\fR field.
.sp
.LP
-Since the\fI_file\fR field has been renamed, attempts to recompile this code
+Since the \fI_file\fR field has been renamed, attempts to recompile this code
will fail. The application should be changed not to use this field in the
\fBFILE\fR structure.
.sp
diff --git a/usr/src/man/man3c/mutex_init.3c b/usr/src/man/man3c/mutex_init.3c
index ed91bf1a86..3a42aee0ec 100644
--- a/usr/src/man/man3c/mutex_init.3c
+++ b/usr/src/man/man3c/mutex_init.3c
@@ -1,4 +1,5 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" Portions Copyright (c) 2001, the Institute of Electrical and Electronics Engineers, Inc. and The Open Group. All Rights Reserved.
.\" Portions Copyright (c) 1995 IEEE All Rights Reserved.
@@ -9,7 +10,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH MUTEX_INIT 3C "Jun 5, 2007"
+.TH MUTEX_INIT 3C "Oct 22, 2014"
.SH NAME
mutex_init, mutex_lock, mutex_trylock, mutex_unlock, mutex_consistent,
mutex_destroy \- mutual exclusion locks
@@ -130,7 +131,7 @@ then attempt to make the state protected by the mutex consistent, since this
state could have been left inconsistent when the last owner died. If the new
owner is able to make the state consistent, it should call
\fBmutex_consistent()\fR to restore the state of the mutex and then unlock the
-mutex. All subsequent calls to \fBmutex_lock()\fRwill then behave normally.
+mutex. All subsequent calls to \fBmutex_lock()\fR will then behave normally.
Only the new owner can make the mutex consistent. If for any reason the new
owner is not able to make the state consistent, it should not call
\fBmutex_consistent()\fR but should simply unlock the mutex. All waiting
@@ -245,7 +246,7 @@ A mutex lock must not be reinitialized while in use by other threads.
.sp
.LP
These rules do not apply to \fBLOCK_ROBUST\fR mutexes. See the description for
-\fBLOCK_ROBUST\fRabove. If default mutex attributes are used, the macro
+\fBLOCK_ROBUST\fR above. If default mutex attributes are used, the macro
\fBDEFAULTMUTEX\fR can be used to initialize mutexes that are statically
allocated.
.sp
@@ -790,7 +791,7 @@ The following example shows how to use a \fBUSYNC_PROCESS\fR |
buffer = (buffer_t *)mmap(NULL, sizeof(buffer_t),
PROT_READ | PROT_WRITE, MAP_SHARED, ipc_fd, 0);
mutex_init(&buffer->Interprocess_mutex,
- USYNC_PROCESS | LOCK_ROBUST,0);
+ USYNC_PROCESS | LOCK_ROBUST, 0);
} else {
create_shared_memory();
ipc_fd = open(INTERPROCESS_FILE, O_RDWR);
@@ -798,7 +799,7 @@ The following example shows how to use a \fBUSYNC_PROCESS\fR |
PROT_READ | PROT_WRITE, MAP_SHARED, ipc_fd, 0);
buffer->Interprocess_data = 0;
mutex_init(&buffer->Interprocess_mutex,
- USYNC_PROCESS | LOCK_ROBUST,0);
+ USYNC_PROCESS | LOCK_ROBUST, 0);
}
for(;;) {
rc = mutex_lock(&buffer->Interprocess_mutex);
diff --git a/usr/src/man/man3nsl/rpc_control.3nsl b/usr/src/man/man3nsl/rpc_control.3nsl
index 58eae610a9..466c6f0d09 100644
--- a/usr/src/man/man3nsl/rpc_control.3nsl
+++ b/usr/src/man/man3nsl/rpc_control.3nsl
@@ -1,10 +1,11 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright 1989 AT&T
.\" Copyright (C) 1999, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH RPC_CONTROL 3NSL "Feb 24, 1999"
+.TH RPC_CONTROL 3NSL "Oct 22, 2014"
.SH NAME
rpc_control \- library routine for manipulating global RPC attributes for
client and server applications
@@ -110,7 +111,7 @@ transports ignore \fBRPC_SVC_CONNMAXREC_SET\fR and
.sp
.LP
This routine returns \fBTRUE\fR if the operation was successful and
-returns\fBFALSE\fR otherwise.
+returns \fBFALSE\fR otherwise.
.SH ATTRIBUTES
.sp
.LP
diff --git a/usr/src/man/man3nsl/t_rcvudata.3nsl b/usr/src/man/man3nsl/t_rcvudata.3nsl
index 1149f71eb2..7c35da1b20 100644
--- a/usr/src/man/man3nsl/t_rcvudata.3nsl
+++ b/usr/src/man/man3nsl/t_rcvudata.3nsl
@@ -1,4 +1,5 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright 1994, The X/Open Company Ltd. All Rights Reserved Portions Copyright 1989 AT&T Portions Copyright (c) 1998, Sun Microsystems, Inc. All Rights Reserved
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
@@ -7,7 +8,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH T_RCVUDATA 3NSL "May 7, 1998"
+.TH T_RCVUDATA 3NSL "Oct 22, 2014"
.SH NAME
t_rcvudata \- receive a data unit
.SH SYNOPSIS
@@ -184,7 +185,7 @@ The \fBXTI\fR interfaces use the header file, \fBxti.h\fR. \fBTLI\fR interfaces
should \fInot\fR use this header. They should use the header:
.br
.in +2
-#include<tiuser.h>
+#include <tiuser.h>
.in -2
.SS "Error Description Values"
.sp
diff --git a/usr/src/man/man3nsl/xdr_simple.3nsl b/usr/src/man/man3nsl/xdr_simple.3nsl
index db0964d525..a39df22e31 100644
--- a/usr/src/man/man3nsl/xdr_simple.3nsl
+++ b/usr/src/man/man3nsl/xdr_simple.3nsl
@@ -1,10 +1,11 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 1989 AT&T
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH XDR_SIMPLE 3NSL "Aug 27, 2001"
+.TH XDR_SIMPLE 3NSL "Oct 22, 2014"
.SH NAME
xdr_simple, xdr_bool, xdr_char, xdr_double, xdr_enum, xdr_float, xdr_free,
xdr_hyper, xdr_int, xdr_long, xdr_longlong_t, xdr_quadruple, xdr_short,
@@ -13,7 +14,7 @@ xdr_void \- library routines for external data representation
.SH SYNOPSIS
.LP
.nf
-#include<rpc/xdr.h>
+#include <rpc/xdr.h>
diff --git a/usr/src/man/man5/kerberos.5 b/usr/src/man/man5/kerberos.5
index 29a64655f2..a27c1a9fdd 100644
--- a/usr/src/man/man5/kerberos.5
+++ b/usr/src/man/man5/kerberos.5
@@ -1,9 +1,10 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH KERBEROS 5 "Oct 1, 2008"
+.TH KERBEROS 5 "Oct 22, 2014"
.SH NAME
kerberos \- overview of Solaris Kerberos implementation
.SH DESCRIPTION
@@ -126,7 +127,7 @@ The following are examples of valid principal names:
.LP
The first four cases are \fIuser principals\fR. In the first two cases, it is
assumed that the user \fBjoe\fR is in the same realm as the client, so no realm
-is specified. Note that \fBjoe\fRand \fBjoe/admin\fR are different principals,
+is specified. Note that \fBjoe\fR and \fBjoe/admin\fR are different principals,
even if the same user uses them; \fBjoe/admin\fR has different privileges from
\fBjoe\fR. The fifth case is a \fIservice principal\fR, while the final case is
a \fIhost principal\fR. The word \fBhost\fR is required for host principals.
diff --git a/usr/src/man/man9f/kmem_alloc.9f b/usr/src/man/man9f/kmem_alloc.9f
index 969b730f73..9c4f8ccb0c 100644
--- a/usr/src/man/man9f/kmem_alloc.9f
+++ b/usr/src/man/man9f/kmem_alloc.9f
@@ -1,10 +1,11 @@
'\" te
+.\" Copyright 2014 Nexenta Systems, Inc. All rights reserved.
.\" Copyright 1989 AT&T
.\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH KMEM_ALLOC 9F "Jan 16, 2006"
+.TH KMEM_ALLOC 9F "Oct 22, 2014"
.SH NAME
kmem_alloc, kmem_zalloc, kmem_free \- allocate kernel memory
.SH SYNOPSIS
@@ -25,7 +26,7 @@ kmem_alloc, kmem_zalloc, kmem_free \- allocate kernel memory
.LP
.nf
-\fBvoid\fR \fBkmem_free\fR(\fBvoid*\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
+\fBvoid\fR \fBkmem_free\fR(\fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fIsize\fR);
.fi
.SH INTERFACE LEVEL
diff --git a/usr/src/pkg/manifests/system-test-libctest.mf b/usr/src/pkg/manifests/system-test-libctest.mf
index c65250d7a5..bfb547a911 100644
--- a/usr/src/pkg/manifests/system-test-libctest.mf
+++ b/usr/src/pkg/manifests/system-test-libctest.mf
@@ -43,6 +43,11 @@ $(i386_ONLY)file path=opt/libc-tests/tests/wcsrtombs_test.amd64 mode=0555
$(i386_ONLY)file path=opt/libc-tests/tests/wcsrtombs_test.i386 mode=0555
$(sparc_ONLY)file path=opt/libc-tests/tests/wcsrtombs_test.sparc mode=0555
$(sparc_ONLY)file path=opt/libc-tests/tests/wcsrtombs_test.sparcv9 mode=0555
+file path=opt/libc-tests/tests/wctype_test mode=0555
+$(i386_ONLY)file path=opt/libc-tests/tests/wctype_test.amd64 mode=0555
+$(i386_ONLY)file path=opt/libc-tests/tests/wctype_test.i386 mode=0555
+$(sparc_ONLY)file path=opt/libc-tests/tests/wctype_test.sparc mode=0555
+$(sparc_ONLY)file path=opt/libc-tests/tests/wctype_test.sparcv9 mode=0555
license lic_CDDL license=lic_CDDL
depend fmri=locale/de type=require
depend fmri=locale/en type=require
diff --git a/usr/src/test/libc-tests/runfiles/default.run b/usr/src/test/libc-tests/runfiles/default.run
index ae204ecccd..8602bbc543 100644
--- a/usr/src/test/libc-tests/runfiles/default.run
+++ b/usr/src/test/libc-tests/runfiles/default.run
@@ -27,3 +27,5 @@ outputdir = /var/tmp/test_results
[/opt/libc-tests/tests/nl_langinfo_test]
[/opt/libc-tests/tests/wcsrtombs_test]
+
+[/opt/libc-tests/tests/wctype_test]
diff --git a/usr/src/test/libc-tests/tests/Makefile b/usr/src/test/libc-tests/tests/Makefile
index 01207bd6d1..ece9ea77b3 100644
--- a/usr/src/test/libc-tests/tests/Makefile
+++ b/usr/src/test/libc-tests/tests/Makefile
@@ -14,7 +14,7 @@
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
#
-SUBDIRS = newlocale nl_langinfo wcsrtombs
+SUBDIRS = newlocale nl_langinfo wcsrtombs wctype
include $(SRC)/Makefile.master
include $(SRC)/test/Makefile.com
diff --git a/usr/src/test/libc-tests/tests/wctype/Makefile b/usr/src/test/libc-tests/tests/wctype/Makefile
new file mode 100644
index 0000000000..751de6e5dd
--- /dev/null
+++ b/usr/src/test/libc-tests/tests/wctype/Makefile
@@ -0,0 +1,21 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
+#
+
+include $(SRC)/Makefile.master
+
+PROG = wctype_test
+ARCHPROG = wctype_test
+
+include ../Makefile.com
diff --git a/usr/src/test/libc-tests/tests/wctype/wctype_test.c b/usr/src/test/libc-tests/tests/wctype/wctype_test.c
new file mode 100644
index 0000000000..1a426ada57
--- /dev/null
+++ b/usr/src/test/libc-tests/tests/wctype/wctype_test.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014 Lauri Tirkkonen <lotheac@iki.fi>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * This program tests that the characters defined in the POSIX-1.2008 Portable
+ * Character Set are classified correctly by the iswctype and isw* functions.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <wchar.h>
+#include <wctype.h>
+#include <locale.h>
+#include <err.h>
+#include "test_common.h"
+
+wint_t upper_should[] = L"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+wint_t lower_should[] = L"abcdefghijklmnopqrstuvwxyz";
+wint_t digit_should[] = L"0123456789";
+wint_t space_should[] = L"\t\n\v\f\r ";
+wint_t cntrl_should[] = L"\a\b\t\n\v\f\r\0\001\002\003\004\005\006\016\017\020"
+"\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037";
+wint_t punct_should[] = L"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
+wint_t xdigit_should[] = L"0123456789ABCDEFabcdef";
+wint_t blank_should[] = L" \t";
+wint_t only_space_should[] = L" ";
+
+#define test_ctype_subset(x, y) do {\
+ test_t t = test_start(#x "_should is subset of " #y);\
+ wctype_t class = wctype(#y);\
+ if (!class) test_failed(t, "wctype(\"%s\") returned 0", #y);\
+ size_t nchars = (sizeof (x ## _should) / sizeof (*x ## _should)) - 1;\
+ for (wint_t *wc = x ## _should; wc < x ## _should + nchars; wc++) {\
+ if (!iswctype(*wc, class))\
+ test_failed(t, "iswctype(L'%lc', wctype(\"%s\"))"\
+ "returned 0", *wc, #y);\
+ if (!isw ## y(*wc))\
+ test_failed(t, "isw%s(L'%lc') returned 0", #y, *wc);\
+ }\
+ test_passed(t);\
+} while (*"\0")
+
+#define test_ctype(x) test_ctype_subset(x, x)
+
+int main(void) {
+ if (!setlocale(LC_CTYPE, "POSIX"))
+ err(1, "setlocale POSIX failed");
+ test_ctype(upper);
+ test_ctype(lower);
+ test_ctype(digit);
+ test_ctype(space);
+ test_ctype(cntrl);
+ test_ctype(punct);
+ test_ctype(xdigit);
+ test_ctype(blank);
+
+ test_ctype_subset(upper, alpha);
+ test_ctype_subset(lower, alpha);
+ test_ctype_subset(upper, alnum);
+ test_ctype_subset(lower, alnum);
+ test_ctype_subset(digit, alnum);
+ test_ctype_subset(upper, print);
+ test_ctype_subset(lower, print);
+ test_ctype_subset(digit, print);
+ test_ctype_subset(punct, print);
+ test_ctype_subset(only_space, print);
+ test_ctype_subset(upper, graph);
+ test_ctype_subset(lower, graph);
+ test_ctype_subset(digit, graph);
+ test_ctype_subset(punct, graph);
+ return (0);
+}