From: Aram Sargsyan Date: Thu, 19 Oct 2023 08:46:58 +0000 (+0000) Subject: Fix an error in the qp_test.c unit test X-Git-Tag: v9.19.18~34^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b535843bb7cf59b43197e91e8221ecab2a39d779;p=thirdparty%2Fbind9.git Fix an error in the qp_test.c unit test In order to check whether there are enough inserted values the code uses the 'tests' variable (loop counter), which is unreliable, because the loop sometimes removes an item instead of inserting one (when the randomly generated item already exists). Instead of the loop counter, use the existing variable 'inserted', which should indicate the correct number of the inserted items. --- diff --git a/tests/dns/qp_test.c b/tests/dns/qp_test.c index f15022618f9..39c9b688b51 100644 --- a/tests/dns/qp_test.c +++ b/tests/dns/qp_test.c @@ -271,7 +271,7 @@ ISC_RUN_TEST_IMPL(qpiter) { * forward a few steps, then back to the start, * to confirm we can change directions while iterating. */ - if (tests > 3) { + if (inserted > 3) { assert_int_equal( dns_qpiter_next(&qpi, NULL, NULL, &ival), ISC_R_SUCCESS);