Commit Graph

154 Commits

Author SHA1 Message Date
David Schultz
caf17d8660 Regression tests for r197752 (handling of empty/NULL buffers). 2009-10-04 19:44:41 +00:00
Dag-Erling Smørgrav
4138849fa7 Check that flopen() can lock against self and that children inherit the lock. 2009-06-06 19:07:15 +00:00
David Schultz
6685ac34d9 Return -1 instead of 0 upon reaching EOF. This is somewhat ill-advised
because it means getdelim() returns -1 for both error and EOF, and
never returns 0. However, this is what the original GNU	implementation
does, and POSIX inherited the bug.

Reported by:	marcus@
2009-04-06 13:50:04 +00:00
David Schultz
7fb2aa104f Tests for getdelim(). 2009-02-28 06:39:39 +00:00
David Schultz
e2ef8d9b1d Add a file containing tests for simple format specifiers.
Currently it only has tests for a few sign issues with integer
formats, including PR 131880.
2009-02-28 06:37:10 +00:00
David Schultz
f04a5a6c81 Tests for wcscasecmp(), wcsnlen(), and stpncpy(). 2009-02-28 06:34:04 +00:00
Ed Schouten
b3aaa0cc21 Rename all symbols in libmp(3) to mp_*, just like Solaris.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.

libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.

Reviewed by:	deischen, rdivacky
2009-02-26 21:43:15 +00:00
David Schultz
acb3b7c668 Test wprintf() in addition to printf(). 2009-01-31 18:32:39 +00:00
David Schultz
d7b27f3d13 Add tests for conj{,f,l}() that I wrote some time ago. These test the
versions in libm, not the gcc builtins.
2009-01-31 18:31:57 +00:00
Dag-Erling Smørgrav
75bd5e763f #ifdef out the lock-against-self test. I'm not sure it makes sense, and
it relies on non-portable flock(2) semantics.  Not only is flock(2) not
portable, but on some OSes that do have it, it is implemented in terms
of fcntl(2) locks, which are per-process rather than per-descriptor.
2008-10-20 17:26:30 +00:00
David Schultz
73a3a6581e Regression tests for bugs in gdtoa. 2008-09-03 07:35:14 +00:00
David Schultz
b1e24d8714 Test that the result is correctly rounded when |y/x| is huge. 2008-08-02 19:21:33 +00:00
David Schultz
4c7c6686c3 Regression tests for fmtcheck(3).
Obtained from:	NetBSD
2008-08-02 06:03:04 +00:00
David Schultz
eb516506c9 Add some tests for acos*(), asin*(), atan*(), and atan2*(). 2008-07-31 22:43:38 +00:00
David Schultz
8bb8d6397d Add regression tests for fmin{,f,l} and fmax{,f,l}.
I wrote these to test amd64 asm functions that used
maxss, maxsd, minss, and minsd, but it turns out that
those instructions don't handle NaNs and signed zero
in the same way as fmin() and fmax() are required to,
so we're stuck with the C versions for now.
2008-07-03 23:06:06 +00:00
David Schultz
b03825c532 Add some regression tests for printf() with positional arguments.
The first test comes from OpenBSD, and the others are additions or
adaptations.

This is based on OpenBSD's
src/regress/lib/libc/sprintf/sprintf_test.c, v1.3.
I deliberately did not use v1.4 because it's bogus.
2008-06-29 21:03:14 +00:00
David Schultz
c0ff67d57f Regression test for a recently fixed strtod bug. 2008-06-21 19:28:26 +00:00
Sean Farley
0b5e889911 Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
  - gr_equal()
    Perform a deep comparison of two struct grp's.  It does a thorough, yet
    unoptimized comparison of all the members regardless of order.

  - gr_make()
    Create a string (see group(5)) from a struct grp.

  - gr_dup()
    Duplicate a struct grp.  Returns a value that is a single contiguous
    block of memory.

  - gr_scan()
    Create a struct grp from a string (as produced by gr_make()).

MFC after:	3 weeks
2008-04-23 00:49:13 +00:00
David Schultz
e058c00c40 Updates for changes in the way printf() handles hex floating point
numbers.
2008-04-12 03:11:56 +00:00
David Schultz
c79a26333b Add some tests for fma(), fmaf(), and fmal(). 2008-04-03 06:15:58 +00:00
David Schultz
d6722d7484 Test remainderl() and remquol() as well. 2008-03-30 20:48:33 +00:00
David Schultz
958be17bad Add some minimal tests for csqrtl(). 2008-03-30 20:09:51 +00:00
David Schultz
fb3b9b52bc Don't run tests that assume <= 64-bit precision on machines with quad
precision.
2008-03-02 20:49:24 +00:00
David Schultz
a84bcdcea5 Some basic regression tests for {sin,cos,tan}{,f,l}(). 2008-02-18 02:00:16 +00:00
David Schultz
69aa771036 There are 3 tests here, not 2. 2008-02-17 22:45:53 +00:00
David Schultz
007d5445df expm1(-big) generates an inexact exception but not underflow. 2008-01-18 22:10:57 +00:00
David Schultz
e5af135aad Add some regression tests for libm's exponential functions. These
mostly just test corner cases rather than accuracy. Some of the
tests don't pass right now if you compile libm at -O2 due to gcc
constant-folding some things that it shouldn't. I'll fix that
shortly.
2008-01-18 21:46:54 +00:00
David Schultz
dd00a42722 Tests for lrintl() and llrintl(). I didn't add anything specially
tailored for the long double format; instead, I just modified the existing
tests to test lrintl() and llrintl() as well.
2008-01-14 02:18:00 +00:00
David Schultz
5a97a86c28 Fix an amusing typo that has prevented this from compiling since 2004. 2007-12-16 23:38:55 +00:00
David Schultz
3f7112a1f4 Don't try the long double tests on i386. Our reduced precision
can cause them to fail.
2007-12-16 23:36:37 +00:00
David Schultz
64577b835b Remove another Alpha remnant. 2007-12-16 23:00:18 +00:00
David Schultz
83f63fd648 Regression tests for nan{,f,l}(). 2007-12-16 21:19:51 +00:00
David Schultz
2fd9221748 Regression tests for csqrt(3). 2007-12-15 09:16:26 +00:00
David Schultz
1b12fbb195 Remove some test instrumentation. (The Symbol.map changes broke it anyway.) 2007-12-09 21:00:12 +00:00
David Schultz
a468cce785 Fixes to avoid overzealous constant folding. 2007-12-09 20:56:08 +00:00
David Schultz
4e97f925b6 gcc 4 does some overzealous constant folding, and since it doesn't
support FENV_ACCESS, that was causing this test to fail. Use a volatile
to avoid the constant folding.
2007-12-09 20:16:48 +00:00
David Schultz
8b9f0f2a42 Make sure we set the locale to "C" when testing thousands' separator
support, rather than just "", which refers to the system default based
on the environment.
2007-12-03 17:48:55 +00:00
David Schultz
b40c4c7013 Tests for rounding, and for the leading 0's bug. 2007-12-03 07:18:47 +00:00
Dag-Erling Smørgrav
2174a10b9e Add regression tests for flopen(3).
Approved by:	re (blanket)
2007-08-03 11:29:49 +00:00
Michael Bushkov
e088274144 - Bugs in gethostbyXXX/getipnodebyXXX regression tests fixed.
Tests for getipnodebyXXX functions now cover most number of flags
  combinations.

Approved by: re (kensmith), brooks (mentor)
2007-06-24 06:14:18 +00:00
Robert Watson
9af491e24b Add regression tests for ethers(3) functions, including new _r variants.
Four tests currently fail:

  test_ether_line_bad_1() and test_ether_line_bad_2() due to bugs in
  ether_line(3).

  test_ether_ntohost() and test_ether_hostton() due to not being fully
  implemented tests.
2007-05-13 14:03:21 +00:00
Michael Bushkov
a3859aa386 Committing regression tests for all implemented nsswitch databases.
Detailed description and instructions are in the README file.
This work had been basically done during GSoC 2006.

Approved by:	brooks (mentor)
2007-04-15 11:02:31 +00:00
David Schultz
2a5f50a641 Fix a few of the tests so that correct implementations actually pass them. 2007-01-07 09:25:22 +00:00
David Schultz
f56f1d7735 Remove the test that ensures that when the string "nan(...)" is converted
to floating-point, the result is a quiet NaN.  The current implementation
may return a signaling NaN, and the vendor has no plans for changing this,
for reasons explained in the comment I added.
2007-01-03 21:28:26 +00:00
David Schultz
3f29b2ef51 Fix cut-and-paste bugs in the regression tests. 2007-01-03 05:38:08 +00:00
Ruslan Ermilov
2b46c64c9c Remove alpha left-overs. 2006-08-22 08:03:01 +00:00
Simon L. B. Nielsen
6e0d070709 Add a test program which performs some very basic tests of libmp(3).
It is by no means expected to perform a complete test of the library
for correctness, but is meant to test the API to make sure libmp (or
libcrypto) updates don't totally break the library.
2006-07-28 16:00:59 +00:00
Ruslan Ermilov
6aebd02aa8 Style: NO_MAN doesn't need any value. 2006-03-15 10:46:38 +00:00
Hajimu UMEMOTO
9bbad495a3 NOMAN --> NO_MAN 2006-03-07 14:26:17 +00:00
Brooks Davis
97fb6f6f5d Add regression tests for trimdomain(3). 2005-10-05 04:46:10 +00:00
Hajimu UMEMOTO
df66c5631e add simple test script. 2005-05-05 11:26:47 +00:00
Hajimu UMEMOTO
9118a9f020 - add $FreeBSD$.
- enable -r option for regress target.
2005-05-04 19:40:30 +00:00
Hajimu UMEMOTO
d70ba80285 - add $FreeBSD$.
- do service lookup.
- add options to use gethostbyname(3) or getipnodebyname(3) instead
  of getaddrinfo(3).
- add option to do reverse lookup.
2005-05-04 12:02:10 +00:00
Hajimu UMEMOTO
6533c1fe80 This commit was generated by cvs2svn to compensate for changes in r145857,
which included commits to RCS files with non-trunk default branches.
2005-05-04 11:55:42 +00:00
Hajimu UMEMOTO
c01a5804da import of parallel name resolution test.
Obtained from:	NetBSD
2005-05-04 11:55:42 +00:00
David Schultz
5b8adb5fd1 Add missing test-rem.t. 2005-04-02 12:50:28 +00:00
David Schultz
cd775c1a33 A few simple regression tests for remainder(), remainderf(),
remquo(), and remquof().
2005-03-25 06:24:46 +00:00
David Schultz
565b7c794f - Replace fe[gs]etmask() with feenableexcept(), fedisableexcept(), and
fegetexcept().
- Add additional tests for the above.
- Output a separate success message for each of the 8 components of
  this set of tests.
2005-03-16 19:04:45 +00:00
David Schultz
ca4fcf3f3e Test cases for nextafter{,f,l} and nexttoward{,f,l}. 2005-03-07 05:03:46 +00:00
David Schultz
2eb5318e94 - Split tests into three rough categories.
- Use fesetround() instead of fpsetround(), and add tests for
  various rounding modes.
- Test that all NaNs generated are quiet.

Some of these tests won't pass until problems in vendor sources
(gdtoa and gcc) are fixed and new versions imported, but I
want to get these changes into the tree before I accidentally
blow them away again.  :-(
2005-03-01 01:43:20 +00:00
David Schultz
73961b3d51 - Split the printfloat test into 11 individually wrapped and packaged
tests.  (Buy 10, get one free!)  The separate categories were
  already there; they just weren't labeled.
- Use fesetround() instead of fpsetround(), since the former is
  standard and implemented on all supported architectures.  Add
  tests for each rounding mode.
- Add additional tests for subnormals.

Some of these tests won't pass until problems in vendor sources
(gdtoa and gcc) are fixed and new versions imported, but I
want to get these changes into the tree before I accidentally
blow them away.
2005-03-01 01:43:05 +00:00
Ruslan Ermilov
1042be684d Add to CFLAGS. 2005-02-12 18:09:20 +00:00
Nik Clayton
8948ad6b58 Add to CFLAGS, rather than overriding it. Use LDFLAGS for the -L option,
and LDLIBS to specify -ltap.

Submitted by:	ru
2005-02-01 09:26:34 +00:00
Nik Clayton
818287703d Link against libtap (ports/devel/libtap). Replace the calls to assert()
with calls to libtap::ok1(), and make sure the correct number of tests is
planned for, and that the exit code is correct.
2005-02-01 01:53:35 +00:00
David Schultz
b33f870fba Regression tests for [l]lrint[f]() and [l]lround[f](). 2005-01-11 23:13:36 +00:00
Tim J. Robbins
c2089f05ef Remove regression tests for the obsolete rune interface. 2004-11-21 03:21:22 +00:00
Nik Clayton
00e13b1d67 Switch over to a different, more flexible test output protocol that's
understood by Perl's Test::Harness module and prove(1) commands.

Update README to describe the new protocol.  The work's broken down into
two main sets of changes.

First, update the existing test programs (shell scripts and C programs)
to produce output in the ok/not ok format, and to, where possible, also
produce a header describing the number of tests that are expected to be
run.

Second, provide the .t files that actually run the tests.  In some cases
these are copies of, or very similar too, scripts that already existed.
I've kept the old scripts around so that it's possible to verify that
behaviour under this new system (in terms of whether or not a test fails)
is identical to the behaviour under the old system.

Add a TODO file.
2004-11-11 19:47:55 +00:00
Giorgos Keramidas
5b9c5efc57 Add a regression test for floating-point output in the Greek locale.
See revision 1.3 of src/share/numericdef/el_GR.ISO8859-7.src

Reviewed by:	das (a while ago)
2004-10-13 22:32:12 +00:00
Stefan Farfeleder
c904266eac Add regression tests for ilogb{,f,l}(). 2004-10-11 18:40:45 +00:00
Tim J. Robbins
a24d9b9413 Add test programs for mbsnrtowcs() and wcsnrtombs(). 2004-07-21 13:47:48 +00:00
Tim J. Robbins
7cc9e6ddbb Add a skeleton makefile that runs the tests out of libc/regex/grot. 2004-07-19 09:00:26 +00:00
Tim J. Robbins
683d338a83 Oops, test error behaviour of wctrans(), not wctype(). 2004-07-19 08:53:41 +00:00
David Schultz
b3cb43917d While testing fe[gs]etround(), make sure FLT_ROUNDS reflects the
proper rounding mode as well.
2004-07-19 08:17:47 +00:00
Maxim Sobolev
ace18b764a Add qsort, mergesort and heapsort regression tests. 2004-06-25 12:31:12 +00:00
David Schultz
a2ca83c04a Add some fenv.h regression tests. 2004-06-11 03:22:34 +00:00
Brooks Davis
d49b8d3917 Fix stupid patch(1) tricks. Apparently patch thinks all files match the
empty file so if you accidently apply a patch created with diff -N
twice, you get files with duplicate contents.

Reported by:	Antoine Brodin <antoine.brodin at laposte.net>
2004-05-27 17:23:32 +00:00
Brooks Davis
7387768ef4 Add support for an /etc/eui64 file modeled on /etc/ethers. The API is
modeled on ethers(3) except that all functions are thread-safe.

Reviewed by:	simokawa
2004-05-26 22:58:06 +00:00
Tim J. Robbins
7076971c1a Test accumulation of partial multibyte characters in conversion
state objects.
2004-05-11 13:10:47 +00:00
Tim J. Robbins
3a8bdd99cb Reset internal conversion state after triggering conversion errors;
the state is undefined according to the standards, and our undefined
behaviour has changed.
2004-04-07 11:02:51 +00:00
David Schultz
575f4d3239 Add regression tests for printf's %a/%A formats.
While here, disable some of the long double tests on i386, since
FreeBSD/i386 is the only port that doesn't evaluate long doubles in
their full precision (due to constant folding bugs in gcc).
2004-01-19 05:59:07 +00:00
David Schultz
24f285966e Add regression tests for some of the bugs recently discovered in the
vendor's strtod() implementation.

While here, disable some of the long double tests on i386, since
FreeBSD/i386 is the only port that doesn't evaluate long doubles in
their full precision (due to constant folding bugs in gcc).
2004-01-19 05:30:56 +00:00
David Schultz
e5524baebf Work around a recently-introduced gcc bug. The compiler no longer
accepts certain floating point constant representations that are
legal in C99.
2004-01-18 07:06:21 +00:00
Tim J. Robbins
33c50f26da Add regression tests for sgetrune() and sputrune(). 2003-10-30 11:51:36 +00:00
David Schultz
3f0b22498b Add regression tests for floating point parsing in scanf(3). 2003-06-28 09:03:44 +00:00
Tim J. Robbins
57f0ef1f50 Regression tests for wctype(), iswctype(), wctrans(), towctrans(). 2003-06-06 09:42:21 +00:00
David Schultz
60fd7ba74a Add a dozen new tests with the general theme of getting trailing
zeroes right.
2003-04-19 23:53:34 +00:00
David Schultz
3b74a935d6 Add a test case for printf("%5.0f", 0.001). 2003-04-14 11:26:32 +00:00
David Schultz
b0850075ac Additional regression tests for grouping, parsing of '.*', and printing
of %f formats where the number of significant digits is < expt.
2003-04-07 00:42:49 +00:00
Tim J. Robbins
fadfe1d425 Test for bug in revision 1.54 of vfprintf.c. 2003-04-06 08:02:20 +00:00
David Schultz
600276e186 Regression tests for printf()'s floating point formats.
Tests for correct printing of subnormals are lacking.
2003-04-05 22:13:01 +00:00
David Schultz
0c66f5adc3 Write negative zero as '-0.0'. Otherwise, it is parsed as an integer
before being cast to a floating point type, and the sign is lost.
2003-03-27 05:32:28 +00:00
Mike Barcroft
b4e41c1278 Add more tests. Specifically, infinity cast from other types should
always be classified as infinity.
2003-02-08 20:45:48 +00:00
Mike Barcroft
2c4594131f Add regression test for soon-to-be-committed fpclassify(). 2003-02-05 16:40:18 +00:00
Tim J. Robbins
889c37ceb3 Add a regression test for wordexp() and wordfree(). 2003-01-04 05:50:35 +00:00
Tim J. Robbins
a932a3f4b5 Add a test program for perror() that demonstrates two bugs in the
current implementation.
2002-12-19 09:46:10 +00:00
Tim J. Robbins
7d5a41c359 Test that if the buffer argument (`s') to wcrtomb() is NULL then
the value of the supplied wide character is ignored and L'\0' is used
instead. Remove incorrect comments about "internal buffer" since wcrtomb()
does not have one (wctomb() does).
2002-12-19 02:01:39 +00:00
Mike Barcroft
ac3f0d298f Add regression test for strerror()/strerror_r().
Based on:	src/lib/libc/string/strerror.c (rev 1.8)
2002-12-18 16:59:08 +00:00
Tim J. Robbins
85fafcf803 Add test cases for btowc() and wctob() in multibyte locales. 2002-11-10 11:03:32 +00:00
Tim J. Robbins
99eabcc8c3 Test for the zero-length buffer bug corrected in mbrtowc.c revision 1.3. 2002-11-10 10:50:42 +00:00
Tim J. Robbins
10acac81ab Add regression tests for mblen(), mbtowc(), wctomb(), mbstowcs() and
wcstombs(). These tests have already found two libc bugs.
2002-11-09 04:33:02 +00:00