From: Michael Wallner Date: Fri, 23 Oct 2020 15:24:49 +0000 (+0200) Subject: test: fix returnmatcher X-Git-Tag: 1.1.0-beta1~169 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c27e726da1b07ef20a1cabb235f7924a9fed4170;p=m6w6%2Flibmemcached test: fix returnmatcher --- diff --git a/test/lib/MemcachedCluster.cpp b/test/lib/MemcachedCluster.cpp index f94e86ca..ca41a904 100644 --- a/test/lib/MemcachedCluster.cpp +++ b/test/lib/MemcachedCluster.cpp @@ -80,7 +80,7 @@ MemcachedCluster::MemcachedCluster(MemcachedCluster &&mc) noexcept MemcachedCluster &MemcachedCluster::operator=(MemcachedCluster &&mc) noexcept { cluster = move(mc.cluster); memcached_clone(&memc, &mc.memc); - returns = ReturnMatcher{&memc}; + returns = &memc; return *this; } diff --git a/test/lib/ReturnMatcher.cpp b/test/lib/ReturnMatcher.cpp index 82f42d65..cbc9a95b 100644 --- a/test/lib/ReturnMatcher.cpp +++ b/test/lib/ReturnMatcher.cpp @@ -12,6 +12,11 @@ ReturnMatcher ReturnMatcher::operator()(memcached_return_t expected_) { return ReturnMatcher{memc, expected_}; } +ReturnMatcher &ReturnMatcher::operator=(memcached_st *memc_) { + memc = memc_; + return *this; +} + string ReturnMatcher::describe() const { return "is " + to_string(expected) + "\n actual: " + memcached_last_error_message(memc); diff --git a/test/lib/ReturnMatcher.hpp b/test/lib/ReturnMatcher.hpp index a5225319..f50212c4 100644 --- a/test/lib/ReturnMatcher.hpp +++ b/test/lib/ReturnMatcher.hpp @@ -29,6 +29,7 @@ public: bool match(const memcached_return_t &arg) const override; ReturnMatcher success(); ReturnMatcher operator()(memcached_return_t expected_); + ReturnMatcher &operator=(memcached_st *memc_); protected: string describe() const override;