Use macro for better message during failure
This commit is contained in:
@ -248,14 +248,12 @@ struct AtomState {
|
|||||||
bool has_mass_setflag = false;
|
bool has_mass_setflag = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
#define ASSERT_ARRAY_ALLOCATED(ptr, enabled) \
|
||||||
void ASSERT_ARRAY_ALLOCATED(const T * ptr, bool enabled) {
|
if (enabled) { \
|
||||||
if (enabled) {
|
ASSERT_NE(ptr, nullptr); \
|
||||||
ASSERT_NE(ptr, nullptr);
|
} else { \
|
||||||
} else {
|
ASSERT_EQ(ptr, nullptr); \
|
||||||
ASSERT_EQ(ptr, nullptr);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void ASSERT_ATOM_STATE_EQ(Atom* atom, const AtomState& expected) {
|
void ASSERT_ATOM_STATE_EQ(Atom* atom, const AtomState& expected) {
|
||||||
ASSERT_THAT(std::string(atom->atom_style), Eq(expected.atom_style));
|
ASSERT_THAT(std::string(atom->atom_style), Eq(expected.atom_style));
|
||||||
|
|||||||
Reference in New Issue
Block a user