2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
18 #include "test/lib/common.hpp"
20 class ReturnMatcher : public Catch::MatcherBase<memcached_return_t> {
22 explicit ReturnMatcher(memcached_st *memc_,
23 memcached_return_t expected_ = MEMCACHED_SUCCESS)
25 , expected{expected_} {}
27 ReturnMatcher(const ReturnMatcher &) = default;
29 bool match(const memcached_return_t &arg) const override;
30 ReturnMatcher success();
31 ReturnMatcher operator()(memcached_return_t expected_);
32 ReturnMatcher &operator=(memcached_st *memc_);
35 string describe() const override;
39 memcached_return_t expected{MEMCACHED_SUCCESS};
42 class LoneReturnMatcher {
44 ReturnMatcher returns;
45 explicit LoneReturnMatcher(memcached_st *memc)