From: Michael Wallner Date: Fri, 3 Mar 2023 10:07:39 +0000 (+0100) Subject: tests: sanitize noblock X-Git-Tag: 1.1.4~1^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7163bb2190def056aab6b9313911616db01a54ca;p=awesomized%2Flibmemcached tests: sanitize noblock --- diff --git a/test/tests/memcached/noblock.cpp b/test/tests/memcached/noblock.cpp index 307c4e3a..dfd4bc56 100644 --- a/test/tests/memcached/noblock.cpp +++ b/test/tests/memcached/noblock.cpp @@ -10,7 +10,7 @@ TEST_CASE("memcached_noblock") { REQUIRE_SUCCESS(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, 1)); REQUIRE_SUCCESS(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout)); - auto num = timeout ? 10'000 : 1'000'000; + auto num = 10000; auto hit = 0u; auto rnd = random_ascii_string(512); for (auto i = 0; i < num; ++i) { @@ -24,16 +24,15 @@ TEST_CASE("memcached_noblock") { case MEMCACHED_TIMEOUT: case MEMCACHED_WRITE_FAILURE: ++hit; - REQUIRE(true); break; default: REQUIRE(false); } } - INFO("failures triggered: " << hit); + INFO("timeout=" << timeout << " failures triggered: " << hit); if (timeout) { - CHECK_FALSE(hit); + REQUIRE_FALSE(hit); } else { - CHECK(hit > 0); + REQUIRE(hit > 0); } }