Files
scylladb/tests/urchin/mutation_assertions.hh
Tomasz Grabiec 677b57dea2 tests: Introduce mutation_assertions.hh
For fluent asserting mutations:

  assert_that(what_we_got).is_equal_to(what_we_expect);

We could extend that in future with more specific checks, like
has_cell() etc.
2015-05-08 09:19:01 +02:00

27 lines
479 B
C++

/*
* Copyright 2015 Cloudius Systems
*/
#pragma once
#include "mutation.hh"
class mutation_assertion {
const mutation& _m;
public:
mutation_assertion(const mutation& m)
: _m(m)
{ }
void is_equal_to(const mutation& other) {
if (_m != other) {
BOOST_FAIL(sprint("Mutations differ, expected %s\n ...but got: %s", other, _m));
}
}
};
static inline
mutation_assertion assert_that(const mutation& m) {
return { m };
}