summaryrefslogtreecommitdiffstats
path: root/lib/libc/tests
Commit message (Collapse)AuthorAgeFilesLines
* libc: spelling fixes.pfg2016-04-302-4/+4
| | | | Mostly on comments.
* Fix double fclose of `fp1` when freopen failsngie2016-04-201-1/+0
| | | | | | | | | | | | freopen handles closing file descriptors on error, with the exception of fdopen'ed descriptors, so closing an already fclose'd file descriptor is incorrect CID: 1338525 Differential Revision: https://reviews.freebsd.org/D6013 MFC after: 2 weeks Reported by: Coverity Sponsored by: EMC / Isilon Storage Division
* Make sure fmemopen succeeds in :test_append_binary_pos before calling ftellngie2016-04-191-0/+2
| | | | | | | | | | | on the FILE object This fixes potential null pointer dereferences on failure CID: 1254952 MFC after: 2 weeks Reported by: Coverity Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-04-041-1/+1
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * WITHOUT_TOOLCHAIN: Skip building of h_raw.bdrewery2016-03-311-1/+1
| | | | | | | | | | | | | | -fsanitize does not seem to work when a --sysroot is specified and there is no <sysroot>/usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a. Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-1026-0/+512
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-0925-0/+511
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
| * Fix and connect setjmp test.bdrewery2016-03-091-0/+1
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-072-0/+125
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * libc: Add some tests for memcmp().jilles2016-03-062-0/+125
| |
* | MFHgjb2016-02-222-2/+2
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Remove dd xfer stats emitted during buildworldemaste2016-02-182-2/+2
| | | | | | | | They result in gratuitous differences when comparing build log output.
* | MFHgjb2016-02-181-0/+2
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Fix build race after r295643.bdrewery2016-02-171-0/+2
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | Final pass through to fix 'tests' packaging.gjb2016-02-031-0/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | More 'tests' packaging fixes.gjb2016-02-031-1/+3
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | Fix another 'tests' packaging error.gjb2016-02-031-0/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | More 'tests' package fixes.gjb2016-02-031-0/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-02-022-0/+98
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * This seems like a very trivial bug that should have been squashed a longsobomax2016-01-302-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | time ago, but for some reason it was not. Basically, without this change dlopen(3)'ing an empty .so file would just cause application to dump core with SIGSEGV. Make sure the file has enough data for at least the ELF header before mmap'ing it. Add a test case to check that dlopen an empty file return an error. There were a separate discussion as to whether it should be SIGBUS instead when you try to access region mapped from an empty file, but it's definitely SIGSEGV now, so if anyone want to check that please be my guest. Reviewed by: mjg, cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5112
* | First pass to fix the 'tests' packages.gjb2016-02-0223-0/+92
|/ | | | Sponsored by: The FreeBSD Foundation
* Increase the timeout for resolv_test from the default (300 seconds) tongie2015-12-232-4/+13
| | | | | | | | | | | | | | 450 seconds This is required on slower network connections, and on older releases (stable/10 seems to be slower as far as name resolution goes.. not sure why yet). Remove an outdated comment in the Makefile from when I was working on this code over a year ago on github MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Let tsearch()/tdelete() use an AVL tree.ed2015-12-222-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementations of POSIX tsearch() and tdelete() don't attempt to perform any balancing at all. Testing reveals that inserting 100k nodes into a tree sequentially takes approximately one minute on my system. Though most other BSDs also don't use any balanced tree internally, C libraries like glibc and musl do provide better implementations. glibc uses a red-black tree and musl uses an AVL tree. Red-black trees have the advantage over AVL trees that they only require O(1) rotations after insertion and deletion, but have the disadvantage that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n). My take is that it's better to focus on having a lower maximum depth, for the reason that in the case of tsearch() the invocation of the comparator likely dominates the running time. This change replaces the tsearch() and tdelete() functions by versions that create an AVL tree. Compared to musl's implementation, this version is different in two different ways: - We don't keep track of heights; just balances. This is sufficient. This has the advantage that it reduces the number of nodes that are being accessed. Storing heights requires us to also access all of the siblings along the path. - Don't use any recursion at all. We know that the tree cannot 2^64 elements in size, so the height of the tree can never be larger than 96. Use a 128-bit bitmask to keep track of the path that is computed. This allows us to iterate over the same path twice, meaning we can apply rotations from top to bottom. Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion seems to be twice as fast as glibc, whereas deletion has about the same performance. Unlike glibc, it uses a fixed amount of memory. I also experimented with both recursive and iterative bottom-up implementations of the same algorithm. This iterative top-down version performs similar to the recursive bottom-up version in terms of speed and code size. For some reason, the iterative bottom-up algorithm was actually 30% faster for deletion, but has a quadratic memory complexity to keep track of all the parent pointers. Reviewed by: jilles Obtained from: https://github.com/NuxiNL/cloudlibc Differential Revision: https://reviews.freebsd.org/D4412
* Iterate down lib/libc/tests/nss...ngie2015-12-161-0/+1
| | | | | | MFC after: 1 week X-MFC with: r292323 Sponsored by: EMC / Isilon Storage Division
* Integrate tools/regression/lib/libc/nss into the FreeBSD test suite asngie2015-12-1610-0/+5399
| | | | | | | | | | | | | | | | | lib/libc/tests/nss - Convert the testcases to ATF - Do some style(9) cleanups: -- Sort headers -- Apply indentation fixes -- Remove superfluous parentheses - Explicitly print out debug printfs for use with `kyua {debug,report}`; for items that were overly noisy, they've been put behind #ifdef DEBUG conditionals - Fix some format strings MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Add Makefile accidentally missed in r292317ngie2015-12-161-0/+15
| | | | | | MFC after: 1 week X-MFC with: r292317 Sponsored by: EMC / Isilon Storage Division
* Integrate tools/regression/lib/libc/resolv into the FreeBSD test suite asngie2015-12-163-0/+368
| | | | | | | | | lib/libc/tests/resolv Convert the testcases to ATF MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Delete bogus freeing of uninitialized datangie2015-12-081-1/+0
| | | | | | MFC after: 3 days Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division
* Add missing va_ends for corresponding va_starts to clean up variable argumentsngie2015-12-082-0/+4
| | | | | | | | initialized in _test_fmt(..) MFC after: 3 days Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division
* Fix regression in r291738: This really wants -lssp.bdrewery2015-12-051-1/+1
| | | | | | | The normal LIBADD is ssp_nonshared. This also had a DPADD on LIBSSP which does not actually exist, it is blank. Sponsored by: EMC / Isilon Storage Division
* Initialize errno to 0 in the nul testcase before testing itngie2015-12-051-0/+1
| | | | | | | For some odd reason stable/10 requires this, otherwise it always fails the errno == 0 check on line 196. Sponsored by: EMC / Isilon Storage Division
* Fix LDADD/DPADD that should be LIBADD.bdrewery2015-12-0413-52/+27
| | | | Sponsored by: EMC / Isilon Storage Division
* Follow-up r291330: h_testbits.h is only needed by xdr_test.bdrewery2015-11-251-2/+2
| | | | | | X-MFC-With: r291330 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Replace DPSRCS that work fine in SRCS.bdrewery2015-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is so that 'make depend' is not a required build step in these files. DPSRCS is overall unneeded. DPSRCS already contains SRCS, so anything which can safely be in SRCS should be. DPSRCS is mostly just a way to generate files that should not be linked into the final PROG/LIB. For headers and grammars it is safe for them to be in SRCS since they will be excluded during linking and installation. The only remaining uses of DPSRCS are for generating .c or .o files that must be built before 'make depend' can run 'mkdep' on the SRCS c files list. A semi-proper example is in tests/sys/kern/acct/Makefile where a checked-in .c file has an #include on a generated .c file. The generated .c file should not be linked into the final PROG though since it is #include'd. The more proper way here is just to build/link it in though without DPSRCS. Another example is in sys/modules/linux/Makefile where a shell script runs to parse a DPSRCS .o file that should not be linked into the module. Beyond those, the need for DPSRCS is largely unneeded, redundant, and forces 'make depend' to be ran. Generally, these Makefiles should avoid the need for DPSRCS and define proper dependencies for their files as well. An example of an improper usage and why this matters is in usr.bin/netstat. nl_defs.h was only in DPSRCS and so was not generated during 'make all', but only during 'make depend'. The files including it lacked proper depenencies on it, which forced running 'make depend' to workaround that bug. The 'make depend' target should mostly be used for incremental build help, not to produce a working build. This specific example was broken in the meta build until r287905 since it does not run 'make depend'. The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS: SRCS:M*.h' when there is no .depend file. Sponsored by: EMC / Isilon Storage Division MFC after: 1 week
* Use __MAKE_SHELL instead of HOST_SHELL when generating aton_ether_subr.cngie2015-11-231-1/+1
| | | | | | | | | | (HOST_SHELL is used in NetBSD) This fixes permission denied issues when gen_ether_subr is not executable MFC after: 3 days Reported by: José Pérez <fbl@aoek.com> Suggested by: bdrewery, sjg
* Do not print out errno if the call succeeded unexpectedly; this was a mistakengie2015-11-181-2/+2
| | | | | | | | | made in r290868 MFC after: 4 days X-MFC with: r290563, r290868 Reported by: jilles Sponsored by: EMC / Isilon Storage Division
* Add some initial tests for SLIST and STAILQ macrosngie2015-11-162-0/+239
| | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Disable -Wformat with scanfloat_test when compiling with gcc to avoid angie2015-11-151-0/+8
| | | | | | | | | "use of assignment suppression and length modifier together in scanf format" warning on line 90 (it's intentional) MFC after: 1 week X-MFC with: r290537, r290856, r290860 Sponsored by: EMC / Isilon Storage Division
* Fix -Wformat issuesngie2015-11-151-3/+3
| | | | | | | X-MFC with: r290563 MFC after: 1 week Reported by: gcc Sponsored by: EMC / Isilon Storage Division
* Remove unused variables to fix building worldbapt2015-11-154-13/+2
|
* Change WARNS to 2 across the board with all the libc testcasesngie2015-11-152-2/+2
| | | | | | | This effectively "reverts" r290846 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Fix -Wmissing-braces warnings by adding braces around all thengie2015-11-151-138/+138
| | | | | | | | testcase inputs MFC after: 1 week X-MFC with: r290572 Sponsored by: EMC / Isilon Storage Division
* Fix -Wunused warningsngie2015-11-152-4/+3
| | | | | | MFC after: 1 week X-MFC with: r290572 Sponsored by: EMC / Isilon Storage Division
* Bump WARNS to 2ngie2015-11-151-0/+2
| | | | | | MFC after: 1 week X-MFC with: r290532 Sponsored by: EMC / Isilon Storage Division
* Remove unused variables; sort by alignment where neededngie2015-11-154-5/+1
| | | | | | MFC after: 1 week X-MFC with: r290532 Sponsored by: EMC / Isilon Storage Division
* Polish up iswctype_testngie2015-11-151-28/+50
| | | | | | | | | | - Split up the testcases into C locale and ja_JP.eucJP testcases. - Avoid a segfault in the event that setlocale fails, similar to r290843 - Replace `sizeof(x) / sizeof(*x)` pattern with `nitems(x)` MFC after: 1 week X-MFC with: r290532 Sponsored by: EMC / Isilon Storage Division
* Polish up the tests a bit more after projects/collation was merged to headngie2015-11-152-37/+77
| | | | | | | | | | | | | | | Provide more meaningful diagnostic messages if LC_CTYPE can't be set properly instead of segfaulting, because setlocale returns NULL and strcmp(NULL, b) will always segfault Split up the testcases so one failing (in this case en_US.ISO8859-15) won't cause the rest of the testcases to be skipped Remove some unused variables MFC after: 1 week X-MFC with: r290532 Sponsored by: EMC / Isilon Storage Division
* Fix the Indian numbering system (hi_IN.ISCII-DEV) testsngie2015-11-151-4/+4
| | | | | | Submitted by: ache X-MFC with: r290494 (if that ever happens) Sponsored by: EMC / Isilon Storage Division
* Add missing licensing boilerplate to test-fnmatch.cngie2015-11-101-0/+25
| | | | | | | | Carry over licensing author info from fnmatch_test.c (jilles@) MFC after: 1 week X-MFC with: r290572 Sponsored by: EMC / Isilon Storage Division
* Integrate tools/regression/lib/libc/gen into the FreeBSD test suitengie2015-11-0910-1/+1666
| | | | | | | | | | | | | | | | | | | as lib/libc/tests/gen The code in test-fnmatch that was used for generating: - bin/sh/tests/builtins/case2.0 - bin/sh/tests/builtins/case3.0 has been left undisturbed. The target `make sh-tests` has been moved over from tools/regression/lib/libc/gen/Makefile to lib/libc/tests/gen/Makefile and made into a PHONY target case2.0 and case3.0 test input generation isn't being done automatically. This needs additional discussion. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
OpenPOWER on IntegriCloud