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)
26 , actual{new actual_st} {}
28 ~ReturnMatcher() override {
34 ReturnMatcher(const ReturnMatcher &other) {
35 expected = other.expected;
37 actual = new actual_st(other.actual->v);
40 bool match(const memcached_return_t &arg) const override;
41 ReturnMatcher success();
42 ReturnMatcher operator()(memcached_return_t expected_);
43 ReturnMatcher &operator=(memcached_st *memc_);
46 string describe() const override;
50 memcached_return_t expected{MEMCACHED_SUCCESS};
54 explicit actual_st(memcached_return_t _v = MEMCACHED_SUCCESS)
60 class LoneReturnMatcher {
62 ReturnMatcher returns;
63 explicit LoneReturnMatcher(memcached_st *memc)