Skip to content

Commit 7163bb2

Browse files
committed
tests: sanitize noblock
1 parent c4150c3 commit 7163bb2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/tests/memcached/noblock.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ TEST_CASE("memcached_noblock") {
1010
REQUIRE_SUCCESS(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, 1));
1111
REQUIRE_SUCCESS(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, timeout));
1212

13-
auto num = timeout ? 10'000 : 1'000'000;
13+
auto num = 10000;
1414
auto hit = 0u;
1515
auto rnd = random_ascii_string(512);
1616
for (auto i = 0; i < num; ++i) {
@@ -24,16 +24,15 @@ TEST_CASE("memcached_noblock") {
2424
case MEMCACHED_TIMEOUT:
2525
case MEMCACHED_WRITE_FAILURE:
2626
++hit;
27-
REQUIRE(true);
2827
break;
2928
default:
3029
REQUIRE(false);
3130
}
3231
}
33-
INFO("failures triggered: " << hit);
32+
INFO("timeout=" << timeout << " failures triggered: " << hit);
3433
if (timeout) {
35-
CHECK_FALSE(hit);
34+
REQUIRE_FALSE(hit);
3635
} else {
37-
CHECK(hit > 0);
36+
REQUIRE(hit > 0);
3837
}
3938
}

0 commit comments

Comments
 (0)