testing: fix osx
[awesomized/libmemcached] / test / lib / ReturnMatcher.cpp
1 #include "ReturnMatcher.hpp"
2
3 ReturnMatcher &ReturnMatcher::operator=(ReturnMatcher &&rm) {
4 memc = exchange(rm.memc, nullptr);
5 expected = rm.expected;
6 return *this;
7 }
8
9 bool ReturnMatcher::match(const memcached_return_t &arg) const {
10 return arg == expected;
11 }
12
13 ReturnMatcher ReturnMatcher::success() {
14 return ReturnMatcher{memc};
15 }
16
17 ReturnMatcher ReturnMatcher::operator()(memcached_return_t expected_) {
18 return ReturnMatcher{memc, expected_};
19 }
20
21 string ReturnMatcher::describe() const {
22 return "is " + to_string(expected)
23 + "\n actual: " + memcached_last_error_message(memc);
24 }
25
26 ReturnMatcher::ReturnMatcher(ReturnMatcher &&rm) {
27 *this = move(rm);
28 }