Compile tests even if we don't run them (#277)
diff --git a/src/mutator_test.cc b/src/mutator_test.cc
index 1626d82..b1610f6 100644
--- a/src/mutator_test.cc
+++ b/src/mutator_test.cc
@@ -678,23 +678,18 @@
}
TYPED_TEST(MutatorTypedTest, UnknownFieldTextFormat) {
- // NOTE: This test has little chance of passing when method
- // TextFormat::Parser::AllowUnknownField is not available
-#if GOOGLE_PROTOBUF_VERSION >= 3008000 // commit 176f7db11d8242b36a3ea6abb1cc436fca5bf75d of >=3.8.0
+#if GOOGLE_PROTOBUF_VERSION < 3008000 // commit 176f7db11d8242b36a3ea6abb1cc436fca5bf75d of >=3.8.0
+ GTEST_SKIP() << "TextFormat::Parser::AllowUnknownField() is not available";
+#endif // GOOGLE_PROTOBUF_VERSION
typename TestFixture::Message parsed;
EXPECT_TRUE(ParseTextMessage(kUnknownFieldInput, &parsed));
EXPECT_EQ(SaveMessageAsText(parsed), kUnknownFieldExpected);
-#else
- (void)kUnknownFieldExpected;
- (void)kUnknownFieldInput;
- GTEST_SKIP();
-#endif // GOOGLE_PROTOBUF_VERSION
}
TYPED_TEST(MutatorTypedTest, DeepRecursion) {
- // NOTE: This test has little chance of passing when method
- // TextFormat::Parser::SetRecursionLimit is not available
-#if GOOGLE_PROTOBUF_VERSION >= 3008000 // commit d8c2501b43c1b56e3efa74048a18f8ce06ba07fe of >=3.8.0
+#if GOOGLE_PROTOBUF_VERSION < 3008000 // commit d8c2501b43c1b56e3efa74048a18f8ce06ba07fe of >=3.8.0
+ GTEST_SKIP() << "TextFormat::Parser::SetRecursionLimit() is not available";
+#endif // GOOGLE_PROTOBUF_VERSION
typename TestFixture::Message message;
typename TestFixture::Message* last = &message;
for (int i = 0; i < 150; ++i) {
@@ -706,9 +701,6 @@
EXPECT_EQ(i < 100,
ParseBinaryMessage(SaveMessageAsBinary(message), &parsed));
}
-#else
- GTEST_SKIP();
-#endif // GOOGLE_PROTOBUF_VERSION
}
TYPED_TEST(MutatorTypedTest, EmptyMessage) {