Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2005 20:13:14 +0200
From:      Ady <ady@softier.com>
To:        tjr@freebsd.org, freebsd-standards@freebsd.org
Subject:   Where can I find the wchar tests?
Message-ID:  <002501c507c0$888ec3a0$3302a8c0@Softier.local>

next in thread | raw e-mail | index | archive | help
Hi Tim,

I've found the attached note from you dating to 2003.

We are working on porting the wchar library at the moment.
I'd really appreciate if you could point me to where I could find the source
for this set of wchar tests (wcslen, wmemchr, ...)

Thanks in Advance

Ady W
Softier

test-strerror regression test
Tim Robbins tjr at FreeBSD.ORG
<mailto:freebsd-standards%40freebsd.org?Subject=test-strerror%20regression%2
0test&In-Reply-To=6AE199CE-739E-11D7-98DE-0003937E39E0%40mac.com>
Mon Apr 21 00:34:06 PDT 2003
Previous message: test-strerror regression test  <000052.html>
Next message: test-strerror regression test  <000044.html>
Messages sorted by: [ date ] <date.html> [ thread ] <thread.html> [
subject ] <subject.html> [ author ] <author.html>

On Sun, Apr 20, 2003 at 09:10:26PM -0500, David Leimbach wrote:

> In /usr/src/tools/regression/lib/libc/string there is a test
> "test-strerror.c" which attempts to verify a correct value for
> strerror(0);
>
> This is probably a bogus value for strerror even though the posix
> standard
> does say it returns a string for any int.  Unless the locales for the
> area are
> all predefined somewhere we probably don't need this regression test
> as it tests for the validity of the strings.
>
> In fact this test fails due to it not asserting the correct string.
>
> errno = 0;
> sret = strerror(0);
> assert(strcmp(sret, "Unknown Error: 0") == 0);
> assert(errno == EINVAL);
>
>
> I don't think this code has been tested in a long time...  The string
> should be "Undefined error: 0" and why would 0 errno be EINVAL?
>
> If we are going to have a test suite it should at least be correct and
> documented don't you think?

The regression tests are regression tests, and not conformance tests for any
particular standard. FreeBSD prints "Unknown error: x", not "No error"
like MSVC, and not "Error x" like Solaris. FreeBSD 4.8-RELEASE and
5.0-CURRENT
pass the tests.

$ uname -srm
FreeBSD 5.0-CURRENT i386
$ make
cc -O -pipe -mcpu=pentiumpro  test-strerror.c  -o test-strerror
cc -O -pipe -mcpu=pentiumpro  test-wcschr.c  -o test-wcschr
cc -O -pipe -mcpu=pentiumpro  test-wcscmp.c  -o test-wcscmp
cc -O -pipe -mcpu=pentiumpro  test-wcslen.c  -o test-wcslen
cc -O -pipe -mcpu=pentiumpro  test-wmemchr.c  -o test-wmemchr
cc -O -pipe -mcpu=pentiumpro  test-wmemset.c  -o test-wmemset
for p in test-strerror   test-wcschr     test-wcscmp     test-wcslen
test-wmemchr    test-wmemset; do
/home/tim/p4/wchar/src/tools/regression/lib/libc/string/$p; done
PASS strerror()
PASS strerror_r()
PASS wcschr()
PASS wcscmp()
PASS wcslen()
PASS wmemchr()
PASS wmemset()


Tim

Previous message: test-strerror regression test  <000052.html>
Next message: test-strerror regression test  <000044.html>
Messages sorted by: [ date ] <date.html> [ thread ] <thread.html> [
subject ] <subject.html> [ author ] <author.html>

More information about the freebsd-standards mailing list
<http://lists.freebsd.org/mailman/listinfo/freebsd-standards>;




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002501c507c0$888ec3a0$3302a8c0>