projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
prepare v1.1.4
[awesomized/libmemcached]
/
test
/
lib
/
ReturnMatcher.cpp
diff --git
a/test/lib/ReturnMatcher.cpp
b/test/lib/ReturnMatcher.cpp
index 82f42d6573f3224deceb2497806a090852a69c79..7a073f29120186a5147af10bfa6fdace47087912 100644
(file)
--- a/
test/lib/ReturnMatcher.cpp
+++ b/
test/lib/ReturnMatcher.cpp
@@
-1,7
+1,13
@@
#include "ReturnMatcher.hpp"
bool ReturnMatcher::match(const memcached_return_t &arg) const {
#include "ReturnMatcher.hpp"
bool ReturnMatcher::match(const memcached_return_t &arg) const {
- return arg == expected;
+ if (arg != expected) {
+ if (expected == MEMCACHED_SUCCESS && arg == MEMCACHED_BUFFERED && memc) {
+ return memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS);
+ }
+ return false;
+ }
+ return true;
}
ReturnMatcher ReturnMatcher::success() {
}
ReturnMatcher ReturnMatcher::success() {
@@
-12,8
+18,13
@@
ReturnMatcher ReturnMatcher::operator()(memcached_return_t expected_) {
return ReturnMatcher{memc, expected_};
}
return ReturnMatcher{memc, expected_};
}
+ReturnMatcher &ReturnMatcher::operator=(memcached_st *memc_) {
+ memc = memc_;
+ return *this;
+}
+
string ReturnMatcher::describe() const {
string ReturnMatcher::describe() const {
- return "
is " + to_string(expected)
- + "
\n actual
: " + memcached_last_error_message(memc);
+ return "
// but '" + to_string(expected) + "' was expected\n"
+ + "
last error
: " + memcached_last_error_message(memc);
}
}