summaryrefslogtreecommitdiffstats
path: root/lib/libnv/tests
Commit message (Collapse)AuthorAgeFilesLines
* MFC r319156,r319159:ngie2017-06-012-1/+2
| | | | | | | | | | | | | | | | | | r319156: :nvlist_unpack__duplicate_key : check the result of nvlist_pack(3) This fixes a potential NULL pointer dereference. CID: 1362051 r319159: :dnvlist_get_string__default_value: fix a bogus string comparison test Check actual_value vs "5", not "5" vs itself. CID: 1362021
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MFHgjb2016-03-101-0/+24
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-091-0/+24
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | First pass to fix the 'tests' packages.gjb2016-02-021-0/+4
|/ | | | Sponsored by: The FreeBSD Foundation
* Remove free'ing of an uninitialized variablengie2016-01-041-2/+0
| | | | | | | | | | | Just remove it completely from the test as it's initialized but unused apart from the free(3) call Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reported by: cppcheck Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Use `nitems(x)` macro instead of using hardcoded numbers for indices intongie2016-01-041-53/+59
| | | | | | | | | | | | the nvlists Convert some of the variables from int to unsigned int to squelch -Wsign-compare warnings when converting hardcoded values to nitems(..) Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Convert another `string` variable to `string_arr` missed in r293130ngie2016-01-041-3/+3
| | | | | | | Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Rename nitems and string variables to avoid collisionsngie2016-01-041-105/+106
| | | | | | | | | | | | | | Rename the `nitems` variable to `num_items` to avoid collisions with the macro in sys/param.h for counting elements in an array Similarly, rename `string` to `string_arr` to avoid future collisions with potential keywords, as well as make it clear that `string_arr` isn't a char* value, but instead a char** value. Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
* Add sys/types.h for for size_t, etcngie2016-01-031-0/+1
| | | | | | | stable/10 requires it due to header pollution MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-121-2/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* Add support for the arrays in nvlist library.oshogbo2015-08-152-0/+1192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist, descriptor} functions. - Add support for (un)packing arrays. - Add the nvl_array_next field to the nvlist structure. If an array is added by the nvlist_{move,add}_nvlist_array function this field will contains next element in the array. - Add the nitems field to the nvpair and nvpair_header structure. This field contains number of elements in the array. - Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of an array. - Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only on packing/unpacking. - Add new API for traversing arrays (nvlist_get_array_next). - Add the nvlist_get_pararr function which combines the nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in the array it will return next element from array. If nvlist is last element in array or it isn't in array it will return his container (parent). This function should simplify traveling over nvlist. - Add tests for new features. - Add documentation for new functions. - Add my copyright. - Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file. PR: 191083 Reviewed by: allanjude (doc) Approved by: pjd (mentor)
* Let the nv.h and dnv.h includes be only in sys directory.oshogbo2015-07-028-15/+15
| | | | | | | Change consumers to include those files from sys. Add duplicated files to ObsoleteFiles. Approved by: pjd (mentor)
* Add test case for unpack with diffrent flags.oshogbo2015-05-021-0/+35
| | | | Approved by: pjd (mentor)
* Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.oshogbo2015-05-022-4/+4
| | | | | | | | | | | | | | | | | Change the nvlist_recv() function to take additional argument that specifies flags expected on the received nvlist. Receiving a nvlist with different set of flags than the ones we expect might lead to undefined behaviour, which might be potentially dangerous. Update consumers of this and related functions and update the tests. Approved by: pjd (mentor) Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist and cap_xfer_nvlist. Reviewed by: AllanJude Approved by: pjd (mentor)
* Remove the use of nvlist_.*[fv] functions from tests.oshogbo2015-04-292-48/+24
| | | | Approved by: pjd (mentor)
* Fix lib/libnv tests compilation with -std=c++11, by adding appropriatedim2015-03-082-11/+11
| | | | | | | casts for NULL to invocations of the ATF_REQUIER_EQ() macro. Reviewed by: rstone, jmmv Differential Revision: https://reviews.freebsd.org/D2027
* Fix build of nv_tests.ccrstone2015-03-011-1776/+0
| | | | | | | | | nv_tests.cc managed to get two copies of several functions due to me applying a patch in an unclean working tree. My kingdom for an "svn clean" command. MFC after: 1 month X-MFC-With: r279424
* Prevent creation of an invalid nvlistrstone2015-03-011-0/+33
| | | | | | | | | | | If an nvlist is set as a child of another nvlist with nvlist_move_nvlist then fail the operation and set the parent nvlist to the error state. Differential Revision: https://reviews.freebsd.org/D1880 Reviewers: jfv MFC after: 1 month Sponsored by: Sandvine Inc
* Add function to force an nvlist into the error staterstone2015-03-011-0/+36
| | | | | | | | | | | Add an nvlist_set_error() function that can be used to force an nvlist into the error state. This is useful both for writing tests and for writing APIs that use nvlists internally. Differential Revision: https://reviews.freebsd.org/D1878 Reviewed by: pjd, jfv MFC After: 1 month Sponsored by: Sandvine Inc.
* Extend the unit test to fix the bug caught in r277925rstone2015-03-011-2/+19
| | | | | | Differential Revision: https://reviews.freebsd.org/D1888 MFC After: 1 month Sponsored by: Sandvine Inc.
* Add tests for dnvlist_take_*rstone2015-03-011-0/+288
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1876 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for dnv_get_*rstone2015-03-012-1/+292
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1875 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_free* functionsrstone2015-03-011-0/+206
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1874 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_take_*rstone2015-03-011-0/+292
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1873 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add test cases for nvlist_move_*rstone2015-03-011-0/+82
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1872 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_pack/unpackrstone2015-03-011-0/+185
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1871 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Add tests for nvlist_clonerstone2015-03-011-0/+120
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1870 Reviewed by: pjd, jfv MFC after: 1 month Sponsored by: Sandvine Inc
* Tests of basic nvlist add functionsrstone2015-03-012-1/+2079
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Revert r279422. My "apply patch and commit" script wasn't addingrstone2015-03-011-3/+1
| | | | | | new files properly. Pointy hat to: rstone
* Tests of basic nvlist add functionsrstone2015-03-011-1/+3
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1869 Reviewed by: jfv, pjd MFC after: 1 month Sponsored by: Sandvine Inc.
* Convert libraries to use LIBADDbapt2014-11-251-2/+1
| | | | While here reduce a bit overlinking
* Integrate lib/libnv into the build/kyuangie2014-08-057-0/+1423
Rename all of the TAP test applications from <test> to <test>_test to match the convention described in the TestSuite wiki page Phabric: D538 Approved by: jmmv (mentor) Sponsored by: EMC / Isilon Storage Division
OpenPOWER on IntegriCloud