21 #ifndef KINETIC_CPP_CLIENT_MATCHERS_H_
22 #define KINETIC_CPP_CLIENT_MATCHERS_H_
26 #include "gmock/gmock.h"
30 using std::shared_ptr;
33 using ::testing::MatcherInterface;
34 using ::testing::Matcher;
40 virtual bool MatchAndExplain(
const shared_ptr<const string> other,
41 testing::MatchResultListener *listener)
const {
45 *listener <<
"expected = <" << s_ <<
">, actual = <" << *other <<
">";
49 virtual void DescribeTo(::std::ostream *os)
const {
57 inline Matcher<shared_ptr<const string>> StringSharedPtrEq(
const string s) {
65 virtual bool MatchAndExplain(vector<string>* other,
66 testing::MatchResultListener *listener)
const {
70 *listener <<
"expected = <" << v_.size() <<
">, actual = <" << other->size() <<
">";
74 virtual void DescribeTo(::std::ostream *os)
const {
75 *os <<
"v=" << v_.size();
82 inline Matcher<vector<string>*> VectorStringPtrEq(vector<string> v) {
91 testing::MatchResultListener *listener)
const {
92 if (code_ == other.statusCode() && message_ == other.message()) {
96 *listener <<
"expected = <" <<
static_cast<int>(code_) <<
":" << message_ <<
">, actual = <"
97 << static_cast<int>(other.statusCode()) <<
":" << other.message() <<
">";
101 virtual void DescribeTo(::std::ostream *os)
const {
102 *os <<
"expected = <" <<
static_cast<int>(code_) <<
":" << message_ <<
">";
110 inline Matcher<KineticStatus> KineticStatusEq(StatusCode code,
string message) {
115 #endif // KINETIC_CPP_CLIENT_MATCHERS_H_
Indicates whether a Kinetic operation (get, put, security, etc) put succeeded or failed. Unlike Status it provides details like whether the failure resulted from a version or an HMAC error.