Module Name:    src
Committed By:   perseant
Date:           Sun Jul 23 19:16:11 UTC 2017

Modified Files:
        src/tests/lib/libc/locale [perseant-stdc-iso10646]: Makefile
            ducet_test.h t_ducet.c

Log Message:
Add Unicode copyright notice and more verbose DUCET test.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/tests/lib/libc/locale/ducet_test.h \
    src/tests/lib/libc/locale/t_ducet.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/locale/Makefile
diff -u src/tests/lib/libc/locale/Makefile:1.10.2.1 src/tests/lib/libc/locale/Makefile:1.10.2.2
--- src/tests/lib/libc/locale/Makefile:1.10.2.1	Fri Jul 14 15:53:08 2017
+++ src/tests/lib/libc/locale/Makefile	Sun Jul 23 19:16:11 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10.2.1 2017/07/14 15:53:08 perseant Exp $
+# $NetBSD: Makefile,v 1.10.2.2 2017/07/23 19:16:11 perseant Exp $
 
 .include <bsd.own.mk>
 

Index: src/tests/lib/libc/locale/ducet_test.h
diff -u src/tests/lib/libc/locale/ducet_test.h:1.1.2.1 src/tests/lib/libc/locale/ducet_test.h:1.1.2.2
--- src/tests/lib/libc/locale/ducet_test.h:1.1.2.1	Fri Jul 14 15:53:08 2017
+++ src/tests/lib/libc/locale/ducet_test.h	Sun Jul 23 19:16:11 2017
@@ -6,6 +6,39 @@
 /* UCA Version: 10.0.0*/
 /* UCD Version: 10.0.0*/
 /* For a description of the format and usage, see CollationTest.html*/
+/*
+ * Copyright © 1991-2017 Unicode, Inc. All rights reserved.
+ * Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of the Unicode data files and any associated documentation
+ * (the "Data Files") or Unicode software and any associated documentation
+ * (the "Software") to deal in the Data Files or Software
+ * without restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, and/or sell copies of
+ * the Data Files or Software, and to permit persons to whom the Data Files
+ * or Software are furnished to do so, provided that either
+ * (a) this copyright and permission notice appear with all copies
+ * of the Data Files or Software, or
+ * (b) this copyright and permission notice appear in associated
+ * Documentation.
+ * 
+ * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+ * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 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 THE DATA FILES OR SOFTWARE.
+ * 
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in these Data Files or Software without prior
+ * written authorization of the copyright holder.
+ */
 #define MAX_TS_LEN 7
 wchar_t ducet_test_data[][MAX_TS_LEN] = {
     {0x0338, 0x0334, 0x0},
Index: src/tests/lib/libc/locale/t_ducet.c
diff -u src/tests/lib/libc/locale/t_ducet.c:1.1.2.1 src/tests/lib/libc/locale/t_ducet.c:1.1.2.2
--- src/tests/lib/libc/locale/t_ducet.c:1.1.2.1	Fri Jul 14 15:53:08 2017
+++ src/tests/lib/libc/locale/t_ducet.c	Sun Jul 23 19:16:11 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ducet.c,v 1.1.2.1 2017/07/14 15:53:08 perseant Exp $ */
+/* $NetBSD: t_ducet.c,v 1.1.2.2 2017/07/23 19:16:11 perseant Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2011\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ducet.c,v 1.1.2.1 2017/07/14 15:53:08 perseant Exp $");
+__RCSID("$NetBSD: t_ducet.c,v 1.1.2.2 2017/07/23 19:16:11 perseant Exp $");
 
 #include <sys/param.h>
 #include <errno.h>
@@ -98,7 +98,7 @@ ATF_TC_BODY(wcsxfrm_ducet, tc)
 	wchar_t *tmp, *oline = NULL, *line;
 	wchar_t xfb1[BUFLEN], xfb2[BUFLEN]; /* Gross overestimates */
 	wchar_t *oxf = xfb1, *xf = xfb2;
-	int i, lineno = 0;
+	int i, lineno = 0, result;
 
 	setlocale(LC_COLLATE, "en_US.UTF-8"); /* should be "vanilla" DUCET, but en_US will do */
 	ATF_REQUIRE_STREQ("en_US.UTF-8", setlocale(LC_COLLATE, NULL));
@@ -122,7 +122,18 @@ ATF_TC_BODY(wcsxfrm_ducet, tc)
 		printf("\n");
 		
 		wcsxfrm(xf, line, BUFLEN);
-		ATF_CHECK(wcscmp(oxf, xf) < 0);
+		result = wcscmp(oxf, xf);
+		if (result > 0) {
+			printf("FAILED result was %d\nweights were ", result);
+			for (i = 0; oxf[i] != 0; i++)
+				printf("0x%lx ", (long)oline[i]);
+			printf(" and ");
+			for (i = 0; xf[i] != 0; i++)
+				printf("0x%lx ", (long)line[i]);
+			printf("\n");
+			
+		}
+		ATF_CHECK(result <= 0);
 
 		/* Swap buffers */
 		tmp = oxf;

Reply via email to