summaryrefslogtreecommitdiffstats
path: root/lib/libc/tests
Commit message (Collapse)AuthorAgeFilesLines
* MFC r318450:kib2017-06-012-0/+103
| | | | | | Add tests for some cases in r318298. PR: 219154
* MFC ↵ngie2017-05-319-98/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r319027,r319028,r319029,r319030,r319031,r319033,r319034,r319035,r319036,r319037,r319038,r319039,r319040,r319041,r319042,r319043,r319044,r319045,r319046: r319027: lib/libc/tests/nss: use calloc appropriately The pattern used prior to this commit was `calloc(1, n * sizeof(type))`; the pattern that should be used however is `calloc(n, sizeof(type))`. r319028: Sort make variables to suit style.Makefile(5) This is being done prior to functional changes. r319029: Staticize functions and remove unused variables to aid with bumping WARNS r319030: Fix -Wsign-compare warnings r319031: getusershell_test: staticize run_tests(..) to fix warnings r319033: getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings r319034: getaddrinfo_test: fix -Wsign-compare warnings r319035: getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings r319036: getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings r319037: getaddrinfo_test: mark unused function parameters __unused to fix -Wunused warnings r319038: getusershell_test: mark mdata parameter in compare_usershell __unused r319039: getserv_test: mark unused parameters __unused to fix corresponding warnings r319040: getrpc_test: fix -Wunused warnings - Mark unused function parameters unused. - Remove an unused function prototype. r319041: getproto_test: fix -Wunused warnings Mark unused parameters __unused in functions. r319042: gethostby_test: fix multiple warning types - Fix -Wmissing-declaration warning by staticizing run_tests. - Fix -Wsign-compare warnings by casting size_t types to int for comparisons. Reindent some of the code in sdump_hostent(..) to accomodate the overall changes. r319043: getpw_test: fix -Wunused warnings - Mark unused parameters __unused. - Put dump_passwd under DEBUG as it's only used in that case. r319044: getgr_test: fix -Wunused warnings r319045: Fix -Wunused and -Wshadow warnings r319046: Fix a -Wunused-but-set-variable warning reported by gcc 6.3.0
* MFC r317034:bapt2017-05-011-0/+93
| | | | | | | | | | | | | | | | | Fix strcoll_l disagreeing with strxfrm by reworking the forward order case in wcscoll_l(). Illumos fixed this while grabbing back our patches: https://www.illumos.org/rb/r/402/ This does not 100% fix what postgresql folks reported as there is still a remaining issue: https://www.illumos.org/issues/7962, it improves the situation The initial issue was reported in postgresql mailing lists: https://www.postgresql.org/message-id/flat/111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com#111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com Submitted by: Yuri Pankov <yuri.pankov@nexenta.com> Obtained from: Illumos
* MFC r302920bapt2017-05-012-0/+64
| | | | | | | | | | | | | | Add a regression test to make sure the Russian collation is actually working when importing collation support from Dragonfly/Illumos amdmi3@ tested the collation branch and reported an issue with Russian collation. John Marino fixed the issue in Dragonfly and I merged it back to FreeBSD. Now that Illumos is working on merging our fixes they (Lauri Tirkkonen) found issues with the commit that fixes the russian collation in UTF-8 that resulted in a crash with strxfrm(3) and the ISO-8859-5 locale (fixed in FreeBSD r302916). This small test was written to ensure we do not bring back the old issue with russian collation while fixing the other issue.
* MFC r315526vangyzen2017-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add clock_nanosleep() Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Regenerate syscall files. Relnotes: yes Sponsored by: Dell EMC
* MFC r316213:kib2017-04-234-0/+260
| | | | | | | | Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1. MFC r316258: Only activate __EXT1_VISIBLE block when using sys/errno.h in userspace.
* MFC r315033asomers2017-04-021-0/+1
| | | | | | | | | | | Increase WARNS for nss tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933
* MFC r315032asomers2017-04-021-0/+1
| | | | | | | | | | | Increase WARNS for iconv tests ATF tests have a default WARNS of 0, unlike other usermode programs. Reviewed by: ngie MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Differential Revision: https://reviews.freebsd.org/D9933
* MFC r314807:ngie2017-03-131-1/+1
| | | | Move ATF_TC_WITHOUT_HEAD(getgrent) near the testcase it annotates
* MFC r313439,r314450:ngie2017-03-072-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313439: Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head The primary end-goal of this drop is ease future merges with NetBSD and collaborate further with the NetBSD project. The goal was (largely, not completely as some items are still oustanding in the NetBSD GNATS system) achieved by doing the following: - Pushing as many changes required to port contrib/netbsd-tests back to NetBSD as possible, then pull the upstream applied changes back in to FreeBSD. - Diff reduce with upstream where possible by: -- Improving libnetbsd header, etc compat glue. -- Using _SED variables to modify test scripts on the fly for items that could not be upstreamed to NetBSD. As a bonus for this work, this change also introduces testcases for uniq(1). Many thanks to Christos for working with me to get many of the changes back into the NetBSD project. In collaboration with: Christos Zoulas <christos@netbsd.org> r314450: Add additional __FreeBSD_version guards around the hsearch_r testcases The reasoning for this is the same as r276046: to ease MFCing the tests to ^/stable/10 . This was accidentally missed in r313439
* MFC r309626,r309627,r309659:bdrewery2017-03-031-5/+10
| | | | | | | | | r309626: strvis(3): Avoid internal state of multibyte functions being tainted. r309627: Remove unneeded hack fixed by r309626. r309659: Support spaces in group names.
* MFC r313378,r313379:ngie2017-02-141-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | r313378: Wrap strcmp/wcscmp calls with ATF_CHECK_MSG and drop atf_tc_fail use The reasoning here was the same as what was done in r313376: - Gather as many results as possible instead of failing early and not testing the rest of the cases. - Simplify logic when checking test inputs vs outputs and printing test result. r313379: Expect :int_within_limits to fail when ptrdiff_t/*intmax_t differ in base type The %t{d,u} (ptrdiff_t) tests fail for the following reasons: - ptrdiff_t is by definition int32_t on !LP64 architectures and int64_t on LP64 architectures. - intmax_t is by definition fixed to int64_t on all architectures. - Some of the code in lib/libc/stdio/... is promoting ptrdiff_t to *intmax_t when parsing/representing the value. PR: 191674
* MFC r313376:ngie2017-02-141-11/+8
| | | | | | | | | | | | | | | | Fix :hexadecimal_floating_point on i386 Don't exclude i386 from LDBL_MANT_DIG == 64; it works properly in that case. While here, replace strcmp + atf_tc_fail with ATF_CHECK_MSG for 2 reasons: - Gather as many results as possible instead of failing early and not testing the rest of the cases. - Simplify logic when checking test inputs vs outputs and printing test result. Tested on: amd64, i386
* MFC r312008:ngie2017-02-123-1/+17
| | | | | | | | | | | | | Upgrade NetBSD tests to 01.11.2017_23.20 snapshot This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386
* MFC r311925,r311968,r311969,r312102,r312108:ngie2017-02-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r311925: Import testcase updates with code contributed back to NetBSD This also (inadvertently) contains an update to contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases). In collaboration with: christos@NetBSD.org r311968: Fix lib/libc/sys/access_test after r311925 sys/param.h needs to be #included in order for __FreeBSD_version to be checked r311969: Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile This is to enable support in other testcases Inspired by lib/msun/tests/Makefile . r312102: Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD r312108: Delete trailing whitespace and use __arraycount instead of nitems in contrib code
* MFC r307220:ngie2016-12-061-2/+2
| | | | | | r307220 (by br): Fix typos: use correct string format and value to compare.
* MFC r305449:ngie2016-12-031-1/+1
| | | | | Install h_db to unbreak some of the lib/libc/db testcases after r305358
* MFC r305921:ngie2016-12-032-6/+6
| | | | Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls
* MFC r305358:ngie2016-12-037-3/+13
| | | | | | | | | | | | | | | | | | | | | Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
* MFC r307700:ngie2016-12-031-1/+4
| | | | Only build lib/libc/tests/iconv if MK_ICONV != no
* MFC r307227 and r307343:ed2016-10-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | Improve typing of POSIX search tree functions. Back in 2015 when I reimplemented these functions to use an AVL tree, I was annoyed by the weakness of the typing of these functions. Both tree nodes and keys are represented by 'void *', meaning that things like the documentation for these functions are an absolute train wreck. To make things worse, users of these functions need to cast the return value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to access the key. Technically speaking such casts violate aliasing rules. I've observed actual breakages as a result of this by enabling features like LTO. I've filed a bug report at the Austin Group. Looking at the way the bug got resolved, they made a pretty good step in the right direction. A new type 'posix_tnode' has been added to correspond to tree nodes. It is still defined as 'void' for source-level compatibility, but in the very far future it could be replaced by a proper structure type containing a key pointer.
* MFC r305961:ngie2016-10-212-0/+4
| | | | | | | | | | Re-add PACKAGE=> tests to lib/libc/tests/net/getaddrinfo/Makefile and add it to lib/libc/tests/sys/Makefile [*] Even though make -VPACKAGE and make -n install seem to do the right thing, the effects are a bit different, depending on the build host. Obtained from: HardenedBSD (af602f0db) [*]
* MFC r305920:ngie2016-10-212-4/+4
| | | | | | | Remove spurious newlines from atf_tc_fail calls This changes the results from broken (incorrect) to failed (correct) on i386
* MFC r305919:ngie2016-10-212-4/+0
| | | | | | | | | Don't define PACKAGE in lib/libc/tests/{iconv,net/getaddrinfo} needlessly This is already being done by bsd.test.mk The other subdirectory Makefiles were intentionally left alone
* MFC r304033:ngie2016-08-281-3/+3
| | | | | | | | | | | Increase timeout from 10 minutes to 20 minutes for all tests On particular slow networks, it can (on average) take longer to resolve hosts to IP* addresses. 20 minutes seemed reasonable for my work network This will be solved in a more meaningful way (if possible) using concurrency in the near future
* MFC r303795:kib2016-08-204-0/+295
| | | | Add __cxa_thread_atexit(3) API implementation.
* This commit addresses regression introduceded in r302177cy2016-06-281-0/+14
| | | | | | | | (WITH_SYSTEM_COMPILER: Enable by default) and it's prerequisite: r300354, caused i386 builds to fail when cross-built on an amd64 host. Reviewed by: bdrewery, delphij, gjb Approved by: re (gjb)
* iconvctl(3): remove superfluous NULL pointer testsvangyzen2016-05-143-0/+79
| | | | | | | | | | | | | | | convname and dst are guaranteed to be non-NULL by iconv_open(3). src is an array. Remove these tests for NULL pointers. While I'm here, eliminate a strlcpy with a correct but suspicious-looking calculation for the third parameter (i.e. not a simple sizeof). Compare the strings in-place instead of copying. Found by: bdrewery Found by: Coverity CID: 1130050, 1130056 MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6338
* Read the contents of the snapshot files properlyngie2016-05-131-18/+15
| | | | | | | | | | - Use fgetln instead of fgets; localize complexity related to fgetln(3) inside the loop. - Skip over blank lines. - Skip over lines (properly) that start with a "#" MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* print_positional_test: Fix misuse of wchar APIscem2016-05-121-3/+4
| | | | | | | | These APIs take unit length, not byte length parameters. Reported by: Coverity CIDs: 1338543, 1338544, 1338545 Sponsored by: EMC / Isilon Storage Division
* nss/gethostby_test: fix broken vector iteration of gethostbyaddr h_aliasescem2016-05-121-1/+1
| | | | | | | | | h_aliases is a NULL-terminated rather than fixed-length array. nitems() is not a valid way to determine its end; instead, check for NULL. Reported by: Coverity CID: 1346578 Sponsored by: EMC / Isilon Storage Division
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-0427-149/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* 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
OpenPOWER on IntegriCloud