aboutsummaryrefslogtreecommitdiff
path: root/tools/regression/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Integrate tools/regression/lib/libc/stdio into the FreeBSD test suiteEnji Cooper2015-11-0825-2295/+0
| | | | | | | | | | | | | | as lib/libc/tests/stdio - Fix some whitespace - Convert the testcases to ATF - Convert "/dev/null" to _PATH_DEVNULL MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=290537
* Reassign copyright statements on several files from AdvancedJohn Baldwin2015-04-232-2/+2
| | | | | | | | | | Computing Technologies LLC to Hudson River Trading LLC. Approved by: Hudson River Trading LLC (who owns ACT LLC) MFC after: 1 week Notes: svn path=/head/; revision=281887
* Garbage collect a prove test wrapperEnji Cooper2015-01-201-15/+0
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/projects/building-blocks/; revision=277445
* Convert tools/regression/lib/libc/stdio/test-fmemopen into an ATF testcase andEnji Cooper2014-11-162-300/+0
| | | | | | | | | rename as lib/libc/stdio/fmemopen2_test Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274592
* - Use strlen instead of hardcoding a numberPietro Cerutti2014-06-031-2/+2
| | | | | | | | | - Terminate a sentence with a period Approved by: cognet Notes: svn path=/head/; revision=267004
* - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).Pietro Cerutti2014-06-021-0/+47
| | | | | | | | | | | | | Update the manpage to reflect this change. - Always set the current position to the first null-byte when opening in append mode. This makes the implementation compatible with glibc's. Update the test suite. Reported by: pho Approved by: cognet Notes: svn path=/head/; revision=266971
* libc/stdio: Fail fdopen() on an execute-only fd.Jilles Tjoelker2014-04-215-1/+237
| | | | | | | | | | | | An execute-only fd (opened with O_EXEC) allows neither read() nor write() and is therefore incompatible with all stdio modes. Therefore, the [EINVAL] error applies. Also adjust the similar check in freopen() with a NULL path, even though this checks an fd which is already from a FILE. Notes: svn path=/head/; revision=264737
* libc: Add fopen() test to regression Makefile.Jilles Tjoelker2014-04-211-3/+11
| | | | Notes: svn path=/head/; revision=264725
* libc/stdio: Allow fopen/freopen modes in any order (except initial r/w/a).Jilles Tjoelker2013-09-062-0/+123
| | | | | | | | | | | | | Austin Group issue #411 requires 'e' to be accepted before and after 'x', and encourages accepting the characters in any order, except the initial 'r', 'w' or 'a'. Given that glibc accepts the characters after r/w/a in any order and that diagnosing this problem may be hard, change our libc to behave that way as well. Notes: svn path=/head/; revision=255303
* libc/stdio: Run mkostemp test using prove.Jilles Tjoelker2013-09-061-0/+10
| | | | Notes: svn path=/head/; revision=255302
* libc/stdio: Provide proper TAP output for fmemopen/open_[w]memstream.Jilles Tjoelker2013-09-063-3/+18
| | | | | | | | A *.t file should provide Test Anything Protocol output so that it can be run using the Perl "prove" tool. Notes: svn path=/head/; revision=255301
* Add mkostemp() and mkostemps().Jilles Tjoelker2013-08-092-3/+167
| | | | | | | | These are like mkstemp() and mkstemps() but allow passing open(2) flags like O_CLOEXEC. Notes: svn path=/head/; revision=254151
* Add an implementation of open_memstream() and open_wmemstream(). TheseJohn Baldwin2013-02-275-1/+429
| | | | | | | | | | | | routines provide write-only stdio FILE objects that store their data in a dynamically allocated buffer. They are a string builder interface somewhat akin to a completely dynamic sbuf. Reviewed by: bde, jilles (earlier versions) MFC after: 1 month Notes: svn path=/head/; revision=247411
* - Fix more style(9)-related issues (copyright header, spaces after functionPietro Cerutti2013-02-011-71/+71
| | | | | | | | | | | | names, unnecessary casts) - Change type of boolean variable from char to bool Suggested by: jhb, zont, jmallett Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246206
* - Remove underscores from the internal structure name, as it doesn't collidePietro Cerutti2013-01-311-27/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the user's namespace. - Correct size and position variables type from long to size_t. - Do not set errno to ENOMEM on malloc failure, as malloc already does so. - Implement the concept of "buffer data length", which mandates what SEEK_END refers to and the allowed extent for a read. - Use NULL as read-callback if the buffer is opened in write-only mode. Conversely, use NULL as write-callback when opened in read-only mode. - Implement the handling of the ``b'' character in the mode argument. A binary buffer differs from a text buffer (default mode if ``b'' is omitted) in that NULL bytes are never appended to writes and that the "buffer data length" equals to the size of the buffer. - Remove shall from the man page. Use indicative instead. Also, specify that the ``b'' flag does not conform with POSIX but is supported by glibc. - Update the regression test so that the ``b'' functionality and the "buffer data length" concepts are tested. - Minor style(9) corrections. Suggested by: jilles Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246148
* Add fmemopen(3), an interface to get a FILE * from a buffer in memory, alongPietro Cerutti2013-01-302-0/+153
| | | | | | | | | | | with the respective regression test. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246120
* libc: Add a missing header to a test program.Jilles Tjoelker2012-12-081-0/+1
| | | | | | | Usage of dup(), mkstemp() and unlink() needs <unistd.h>. Notes: svn path=/head/; revision=244038
* Add .t files for tests, missed in prior checkins, so that prove(1) worksDavid Schultz2012-01-143-0/+30
| | | | | | | in this directory. Notes: svn path=/head/; revision=230115
* Update the tests for arm and other ports where long double is the sameDavid Schultz2012-01-141-3/+3
| | | | | | | as double, similar to r178141. Notes: svn path=/head/; revision=230114
* Regression tests for r197752 (handling of empty/NULL buffers).David Schultz2009-10-041-1/+20
| | | | Notes: svn path=/head/; revision=197753
* Return -1 instead of 0 upon reaching EOF. This is somewhat ill-advisedDavid Schultz2009-04-061-2/+2
| | | | | | | | | | | 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@ Notes: svn path=/head/; revision=190773
* Tests for getdelim().David Schultz2009-02-282-1/+169
| | | | Notes: svn path=/head/; revision=189142
* Add a file containing tests for simple format specifiers.David Schultz2009-02-282-1/+157
| | | | | | | | Currently it only has tests for a few sign issues with integer formats, including PR 131880. Notes: svn path=/head/; revision=189141
* Test wprintf() in addition to printf().David Schultz2009-01-311-3/+19
| | | | Notes: svn path=/head/; revision=187963
* Regression tests for bugs in gdtoa.David Schultz2008-09-031-11/+17
| | | | Notes: svn path=/head/; revision=182711
* Add some regression tests for printf() with positional arguments.David Schultz2008-06-292-1/+133
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=180103
* Regression test for a recently fixed strtod bug.David Schultz2008-06-211-1/+11
| | | | Notes: svn path=/head/; revision=179919
* Updates for changes in the way printf() handles hex floating pointDavid Schultz2008-04-121-5/+5
| | | | | | | numbers. Notes: svn path=/head/; revision=178141
* Remove some test instrumentation. (The Symbol.map changes broke it anyway.)David Schultz2007-12-091-4/+0
| | | | Notes: svn path=/head/; revision=174495
* Make sure we set the locale to "C" when testing thousands' separatorDavid Schultz2007-12-031-2/+2
| | | | | | | | support, rather than just "", which refers to the system default based on the environment. Notes: svn path=/head/; revision=174228
* Tests for rounding, and for the leading 0's bug.David Schultz2007-12-031-1/+13
| | | | Notes: svn path=/head/; revision=174205
* Remove the test that ensures that when the string "nan(...)" is convertedDavid Schultz2007-01-031-0/+8
| | | | | | | | | 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. Notes: svn path=/head/; revision=165754
* Fix cut-and-paste bugs in the regression tests.David Schultz2007-01-031-2/+2
| | | | Notes: svn path=/head/; revision=165748
* - Split tests into three rough categories.David Schultz2005-03-011-6/+98
| | | | | | | | | | | | | | - 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. :-( Notes: svn path=/head/; revision=142843
* - Split the printfloat test into 11 individually wrapped and packagedDavid Schultz2005-03-012-8/+100
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=142842
* Switch over to a different, more flexible test output protocol that'sNik Clayton2004-11-116-3/+38
| | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=137587
* Add a regression test for floating-point output in the Greek locale.Giorgos Keramidas2004-10-131-0/+7
| | | | | | | | | See revision 1.3 of src/share/numericdef/el_GR.ISO8859-7.src Reviewed by: das (a while ago) Notes: svn path=/head/; revision=136497
* Add regression tests for printf's %a/%A formats.David Schultz2004-01-191-1/+38
| | | | | | | | | 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). Notes: svn path=/head/; revision=124708
* Add regression tests for some of the bugs recently discovered in theDavid Schultz2004-01-191-4/+15
| | | | | | | | | | | 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). Notes: svn path=/head/; revision=124707
* Work around a recently-introduced gcc bug. The compiler no longerDavid Schultz2004-01-181-1/+1
| | | | | | | | accepts certain floating point constant representations that are legal in C99. Notes: svn path=/head/; revision=124650
* Add regression tests for floating point parsing in scanf(3).David Schultz2003-06-282-1/+181
| | | | Notes: svn path=/head/; revision=116969
* Add a dozen new tests with the general theme of getting trailingDavid Schultz2003-04-191-0/+12
| | | | | | | zeroes right. Notes: svn path=/head/; revision=113724
* Add a test case for printf("%5.0f", 0.001).David Schultz2003-04-141-0/+2
| | | | Notes: svn path=/head/; revision=113469
* Additional regression tests for grouping, parsing of '.*', and printingDavid Schultz2003-04-071-0/+9
| | | | | | | of %f formats where the number of significant digits is < expt. Notes: svn path=/head/; revision=113192
* Test for bug in revision 1.54 of vfprintf.c.Tim J. Robbins2003-04-061-0/+3
| | | | Notes: svn path=/head/; revision=113162
* Regression tests for printf()'s floating point formats.David Schultz2003-04-052-1/+168
| | | | | | | Tests for correct printing of subnormals are lacking. Notes: svn path=/head/; revision=113147
* Add a test program for perror() that demonstrates two bugs in theTim J. Robbins2002-12-192-0/+116
current implementation. Notes: svn path=/head/; revision=108088