]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
PrintTo functions for google test and valgrind
authorMatthew Barr <matthew.barr@intel.com>
Tue, 8 Mar 2016 03:53:03 +0000 (14:53 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 20 Apr 2016 03:34:54 +0000 (13:34 +1000)
unit/internal/multiaccel_matcher.cpp
unit/internal/nfagraph_repeat.cpp
unit/internal/nfagraph_width.cpp

index 1e689430a8945faf74ba32970d75cbf9079f01ea..34e5c5ed845e1cadd1666f448bda7c733e7e1aed 100644 (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;
+}
index 53506b83b69984276cd5d05016e55e931e263e16..2473d75565e76c8f57092c496d28975c308d3914 100644 (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 << '}';
+}
index 81c49532e1b17797d4435343fae5a66b9ad97a72..03508ea840bd21d049a192d6b295e5af9577f12c 100644 (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 << '}';
+}