PrintTo functions for google test and valgrind

This commit is contained in:
Matthew Barr 2016-03-08 14:53:03 +11:00
parent 4a482b07ea
commit e10d2eb269
3 changed files with 22 additions and 0 deletions

View File

@ -287,3 +287,8 @@ static const MultiaccelTestParam multiaccelTests[] = {
};
INSTANTIATE_TEST_CASE_P(Multiaccel, MultiaccelTest, ValuesIn(multiaccelTests));
// boring stuff for google test
void PrintTo(const MultiaccelTestParam &p, ::std::ostream *os) {
*os << "MultiaccelTestParam: " << p.match_pattern;
}

View File

@ -103,3 +103,9 @@ TEST_P(NFAPureRepeatTest, Check) {
ASSERT_EQ(t.minBound, repeat.bounds.min);
ASSERT_EQ(t.maxBound, repeat.bounds.max);
}
// for google test
void PrintTo(const PureRepeatTest &p, ::std::ostream *os) {
*os << "PureRepeatTest: " << p.pattern
<< "{" << p.minBound << ',' << p.maxBound << '}';
}

View File

@ -84,3 +84,14 @@ TEST_P(NFAWidthTest, Check) {
ASSERT_EQ(t.minWidth, findMinWidth(*w));
ASSERT_EQ(t.maxWidth, findMaxWidth(*w));
}
// for google test
void PrintTo(const WidthTest &w, ::std::ostream *os) {
*os << "WidthTest: " << w.pattern << "{" << w.minWidth << ',';
if (w.maxWidth == depth::infinity()) {
*os << "inf";
} else {
*os << w.maxWidth;
}
*os << '}';
}