Commit Graph
3205 Commits
Author SHA1 Message Date
JoeyandEvan Hunt 37ce8f1021 convert socket_test; remove ATF from lib/isc/tests
(cherry picked from commit 9eea00cd3c)
2018-11-15 01:05:11 -08:00
Evan Hunt 7abdd9e87a convert atomic_test 2018-11-15 00:38:16 -08:00
Evan Hunt b0309ae739 convert isc_ntop_test 2018-11-15 00:24:14 -08:00
Evan Hunt 7bbe60ada1 convert print_test 2018-11-15 00:20:22 -08:00
Evan Hunt 6182c94334 convert regex_test
(cherry picked from commit bd009b34a6)
2018-11-15 00:06:23 -08:00
Evan Hunt 13a6d71e88 convert random_test
(cherry picked from commit 6ad7acd787)
2018-11-15 00:03:52 -08:00
JoeyandEvan Hunt 15f7486d7b convert mem_test
(cherry picked from commit 683094e308)
2018-11-14 22:38:15 -08:00
Evan Hunt 7c4ed64665 convert timer_test
(cherry picked from commit 20cef35ece)
2018-11-14 22:36:45 -08:00
Evan Hunt f524cc713e convert task_test 2018-11-14 22:35:03 -08:00
JoeyandEvan Hunt bdf9ea7de7 convert hash_test
(cherry picked from commit 72f60bdd84)
2018-11-14 22:30:05 -08:00
Evan Hunt 360d7d3d72 convert ht_test
(cherry picked from commit c701f036ea)
2018-11-14 22:15:53 -08:00
Evan Hunt 8d0396737c convert time_test
(cherry picked from commit 3bf9a1e567)
2018-11-14 22:14:54 -08:00
Evan Hunt 98bff81bae convert taskpool_test
(cherry picked from commit c9ff174dce)
2018-11-14 22:14:54 -08:00
Evan Hunt 16d2d27b04 convert pool_test
(cherry picked from commit 4f84acb788)
2018-11-14 22:14:52 -08:00
Evan Hunt be41574a20 convert sockaddr_test
(cherry picked from commit 231436039d)
2018-11-14 22:14:34 -08:00
Evan Hunt ba2262910a convert netaddr_test
(cherry picked from commit 7ab8c5b583)
2018-11-14 22:13:56 -08:00
Evan Hunt 7b2288483f convert symtab_test
(cherry picked from commit 5f377136be)
2018-11-14 22:13:56 -08:00
Evan Hunt b59107e687 convert queue_test
(cherry picked from commit b3db0266cb)
2018-11-14 22:13:54 -08:00
Evan Hunt 3b95658020 convert file_test
(cherry picked from commit 8161be27db)
2018-11-14 22:13:24 -08:00
Evan Hunt 0e08dc2e2b convert lex_test
(cherry picked from commit 4133fd86f1)
2018-11-14 22:13:21 -08:00
Evan Hunt df41c2668f convert errno_test
(cherry picked from commit 049a3a7c0e)
2018-11-14 22:12:50 -08:00
Evan Hunt 5f3ba36436 convert safe_test
(cherry picked from commit c1c8d8846f)
2018-11-14 22:12:47 -08:00
Evan Hunt 5640841732 convert radix_test
(cherry picked from commit 718ca3166c)
2018-11-14 22:10:33 -08:00
Evan Hunt 57d78a76e5 convert heap_test
(cherry picked from commit cc6ab2416b)
2018-11-14 22:10:14 -08:00
Evan Hunt f29a9d5bc5 convert parse_test
(cherry picked from commit a7c308df9c)
2018-11-14 22:08:50 -08:00
Evan Hunt 856add745a convert counter_test
(cherry picked from commit 52b86f0abe)
2018-11-14 22:08:50 -08:00
Evan Hunt 3095574c1c convert buffer_test
(cherry picked from commit 02a5db7631)
2018-11-14 22:08:49 -08:00
Evan Hunt c679b85424 convert aes_test
(cherry picked from commit dc88db015b)
2018-11-14 22:08:26 -08:00
Evan Hunt 41831a7d24 assert if {isc,dns,ns}_test_begin() is called when a prior test is running
(cherry picked from commit d8766293ab)
2018-11-14 22:04:35 -08:00
Evan Hunt 03c7a096c6 remove .NOTPARALLEL so unit tests can build faster
(cherry picked from commit b434b0a4b6)
2018-11-14 21:54:43 -08:00
Mark Andrews 97a108f00d remove lib/isc/tests/result_test as it is now cmocka
(cherry picked from commit 9024cf0c15)
2018-11-13 07:50:13 +11:00
Evan HuntandMark Andrews 0a2706b288 convert result tests to use CMocka instead of ATF
(cherry picked from commit 471110933a)
2018-11-12 15:10:52 +11:00
Mark Andrews 3bc66aa712 check result tables are complete
(cherry picked from commit 4f04a79250)
2018-11-12 15:09:37 +11:00
Ondřej SurýandMark Andrews 3223b1b540 Add support for cmocka assert testing by overriding REQUIRE/INSIST/... macros when UNIT_TESTING is defined
(cherry picked from commit 52731c000d)
2018-11-12 12:31:45 +11:00
Ondřej SurýandMark Andrews 3b2f9ceec6 Integrate cmocka unit testing framework to kyua
(cherry picked from commit 07910f0153)
2018-11-12 12:22:33 +11:00
Ondřej Surý a5e7901eb9 Properly use ATOMIC_*_LOCK_FREE preprocessor constants
The ATOMIC_*_LOCK_FREE can evalutate either 0, 1, or 2 which indicate the
lock-free property of the corresponding atomic types (both signed and unsigned).

	Value	Explanation
	-----	--------------------------------------
	  0	The atomic type is never lock-free
	  1	The atomic type is sometimes lock-free
	  2	The atomic type is always lock-free
	-----	--------------------------------------
2018-11-09 04:50:50 +07:00
Ondřej Surý 956d1bda02 isc_stdtime_t is always 32-bit now, so remove the always true macro STDTIME_ON_32BITS
(cherry picked from commit 6f5fe11f5a)
2018-11-09 02:56:49 +07:00
Ondřej Surý 6610da90d1 Define PK11_UTIMACO_FLAVOR and add detection code to configure.ac
(cherry picked from commit 2079e44fb9)
2018-11-09 00:35:05 +07:00
Ondřej Surý 5ad72603a8 Remove dummy ISLOCKED macro
(cherry picked from commit 68ca987792)
2018-11-08 15:09:12 +07:00
Ondřej Surý 4568669807 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached
(cherry picked from commit 23fff6c569)
2018-11-08 15:09:12 +07:00
Ondřej Surý 1e6329038b Don't assert on failed getrlimit call to allow called to handle this gracefully as it already does, just abort where we need to know the numbers
(cherry picked from commit e2e138a801)
2018-11-08 14:37:14 +07:00
Ondřej Surý 3d834566f1 When ISC assertions are disabled, still execute the condition to prevent unused variable warnings/errors from the compiler
(cherry picked from commit a831e0f72d)
2018-11-08 14:37:14 +07:00
Ondřej Surý fcd1569e2b Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool
(cherry picked from commit b2b43fd235)
2018-11-08 14:37:14 +07:00
Ondřej Surý b222783ae9 Add small tweaks to the code to fix compilation when ISC assertions are disabled
While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)

(cherry picked from commit fbd2e47f51)
2018-11-08 14:05:23 +07:00
Evan Hunt d99a9db93a silence warning from missing print.h
(cherry picked from commit a0de6707c0)
2018-10-30 08:09:28 -07:00
Michał Kępień a21c1aacdf Fix isc_buffer_copyregion() for auto-reallocated buffers
While isc_buffer_copyregion() calls isc_buffer_reserve() to ensure the
target buffer will have enough available space to append the contents of
the source region to it, the variables used for subsequently checking
available space are not updated accordingly after that call.  This
prevents isc_buffer_copyregion() from working as expected for
auto-reallocated buffers: ISC_R_NOSPACE will be returned if enough space
is not already available in the target buffer before it is reallocated.
Fix by calling isc_buffer_used() and isc_buffer_availablelength()
directly instead of assigning their return values to local variables.

(cherry picked from commit e1f0aed034)
2018-10-30 13:33:42 +01:00
Michał Kępień 72caf33ffb Add unit tests for isc_buffer_copyregion()
Add some basic checks for isc_buffer_copyregion() to ensure it behaves
as expected for both fixed-size buffers and buffers which can be
automatically reallocated.  Adjust the list of headers included by
lib/isc/tests/buffer_test.c so that it matches what that test program
really uses.

(cherry picked from commit 15440d8027)
2018-10-30 13:33:42 +01:00
Mark Andrews d09955736a document eol
(cherry picked from commit 97a680e5ce)
2018-10-30 11:16:49 +11:00
Mark Andrews 7ccca052c0 Only set IPV6_USE_MIN_MTU on IPv6.
(cherry picked from commit 561b780ba0)
2018-10-29 17:28:57 +11:00
Mark Andrews 7f07a0bb5d expand the pool then copy over the old entries so we that failures do not break the old pool; also don't leak the new pool on error
(cherry picked from commit afde30fe9b)
2018-10-25 13:20:03 +11:00