From f582c2592afd7a1f5692f482e62d67ca34540fec Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 2 Nov 2020 16:16:13 +0100 Subject: [PATCH] show any system error (errno) --- .../memcached/regression/lp_000-583-031.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/tests/memcached/regression/lp_000-583-031.cpp b/test/tests/memcached/regression/lp_000-583-031.cpp index b6d18870..243c884e 100644 --- a/test/tests/memcached/regression/lp_000-583-031.cpp +++ b/test/tests/memcached/regression/lp_000-583-031.cpp @@ -1,18 +1,20 @@ #include "test/lib/common.hpp" +#include "test/lib/ReturnMatcher.hpp" TEST_CASE("memcached_regression_lp583031") { MemcachedPtr memc; + LoneReturnMatcher test{*memc}; - REQUIRE(MEMCACHED_SUCCESS == memcached_server_add(*memc, "192.0.2.1", 11211)); - REQUIRE(MEMCACHED_SUCCESS == memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, 3000)); - REQUIRE(MEMCACHED_SUCCESS == memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 1000)); - REQUIRE(MEMCACHED_SUCCESS == memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_SND_TIMEOUT, 1000)); - REQUIRE(MEMCACHED_SUCCESS == memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_RCV_TIMEOUT, 1000)); - REQUIRE(MEMCACHED_SUCCESS == memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, 1000)); - REQUIRE(MEMCACHED_SUCCESS == memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT, 3)); + REQUIRE_SUCCESS(memcached_server_add(*memc, "192.0.2.1", 11211)); + REQUIRE_SUCCESS(memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, 3000)); + REQUIRE_SUCCESS(memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 1000)); + REQUIRE_SUCCESS(memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_SND_TIMEOUT, 1000)); + REQUIRE_SUCCESS(memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_RCV_TIMEOUT, 1000)); + REQUIRE_SUCCESS(memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, 1000)); + REQUIRE_SUCCESS(memcached_behavior_set(*memc, MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT, 3)); memcached_return_t rc; Malloced val(memcached_get(*memc, S("not-found"), nullptr, nullptr, &rc)); - REQUIRE(MEMCACHED_TIMEOUT == rc); + REQUIRE_RC(MEMCACHED_TIMEOUT, rc); REQUIRE_FALSE(*val); } -- 2.30.2