Commit Graph

116 Commits

Author SHA1 Message Date
Jilles Tjoelker
4b7fb70199 Generate some tests for sh's case command from the fnmatch tests.
I'm committing the generated files because I don't like a build dependency
for the sh(1) tests, and they are small and will not change much.
2010-05-09 16:15:40 +00:00
Jilles Tjoelker
139ac6b239 fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen.
Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)

PR:		116074
MFC after:	1 week
2010-04-16 22:29:24 +00:00
Jilles Tjoelker
bfbe51816a Add some tests for fnmatch(3).
MFC after:	1 week
2010-04-16 22:15:26 +00:00
Joel Dahl
0371d265dc The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from:	NetBSD
2010-03-03 07:38:12 +00:00
Dag-Erling Smørgrav
2deaa94b6a Add test-pidfile.c and increase warning level. 2009-11-12 01:37:25 +00:00
Dag-Erling Smørgrav
761ea75d41 Test cases for pidfile(3) - including two designed to catch issues arising
from the incorrect use of fcntl(2) instead of flock(2).
2009-11-12 01:37:02 +00:00
Dag-Erling Smørgrav
6830953bc1 Fix warnings and remove one unnecessary use of vfork(). The other could
also be removed with a little more work.
2009-11-12 01:34:55 +00:00
Dag-Erling Smørgrav
a2f8e5b371 Fix warnings 2009-11-12 01:33:57 +00:00
Dag-Erling Smørgrav
1a29dc59c5 Check fork() return value 2009-11-10 10:42:48 +00:00
Jilles Tjoelker
364e9ccb9c wordexp(3): fix some bugs with signals and long outputs
* retry various system calls on EINTR
* retry the rest after a short read (common if there is more than about 1K
  of output)
* block SIGCHLD like system(3) does (note that this does not and cannot
  work fully in threaded programs, they will need to be careful with wait
  functions)

PR:		90580
MFC after:	1 month
2009-10-23 14:50:11 +00:00
Dag-Erling Smørgrav
b146811680 Update copyright. 2009-10-19 07:56:03 +00:00
Dag-Erling Smørgrav
6026385bf4 Remove redundant $FreeBSD$. 2009-10-19 07:55:13 +00:00
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