Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/perseant-stdc-iso10646]: src/tests/lib/libc/locale Add Unicode copyright...
details: https://anonhg.NetBSD.org/src/rev/7ae4530d7a60
branches: perseant-stdc-iso10646
changeset: 850677:7ae4530d7a60
user: perseant <perseant%NetBSD.org@localhost>
date: Sun Jul 23 19:16:11 2017 +0000
description:
Add Unicode copyright notice and more verbose DUCET test.
diffstat:
tests/lib/libc/locale/Makefile | 2 +-
tests/lib/libc/locale/ducet_test.h | 33 +++++++++++++++++++++++++++++++++
tests/lib/libc/locale/t_ducet.c | 19 +++++++++++++++----
3 files changed, 49 insertions(+), 5 deletions(-)
diffs (99 lines):
diff -r 668a3d0fdb90 -r 7ae4530d7a60 tests/lib/libc/locale/Makefile
--- a/tests/lib/libc/locale/Makefile Sun Jul 23 18:51:21 2017 +0000
+++ b/tests/lib/libc/locale/Makefile Sun Jul 23 19:16:11 2017 +0000
@@ -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>
diff -r 668a3d0fdb90 -r 7ae4530d7a60 tests/lib/libc/locale/ducet_test.h
--- a/tests/lib/libc/locale/ducet_test.h Sun Jul 23 18:51:21 2017 +0000
+++ b/tests/lib/libc/locale/ducet_test.h Sun Jul 23 19:16:11 2017 +0000
@@ -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},
diff -r 668a3d0fdb90 -r 7ae4530d7a60 tests/lib/libc/locale/t_ducet.c
--- a/tests/lib/libc/locale/t_ducet.c Sun Jul 23 18:51:21 2017 +0000
+++ b/tests/lib/libc/locale/t_ducet.c Sun Jul 23 19:16:11 2017 +0000
@@ -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 @@
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 @@
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;
Home |
Main Index |
Thread Index |
Old Index