@@ -678,23 +678,18 @@ TYPED_TEST(MutatorTypedTest, Serialization) {
678
678
}
679
679
680
680
TYPED_TEST (MutatorTypedTest, UnknownFieldTextFormat) {
681
- // NOTE: This test has little chance of passing when method
682
- // TextFormat::Parser::AllowUnknownField is not available
683
- #if GOOGLE_PROTOBUF_VERSION >= 3008000 // commit 176f7db11d8242b36a3ea6abb1cc436fca5bf75d of >=3.8.0
681
+ # if GOOGLE_PROTOBUF_VERSION < 3008000 // commit 176f7db11d8242b36a3ea6abb1cc436fca5bf75d of >=3.8.0
682
+ GTEST_SKIP () << " TextFormat::Parser::AllowUnknownField() is not available" ;
683
+ #endif // GOOGLE_PROTOBUF_VERSION
684
684
typename TestFixture::Message parsed;
685
685
EXPECT_TRUE (ParseTextMessage (kUnknownFieldInput , &parsed));
686
686
EXPECT_EQ (SaveMessageAsText (parsed), kUnknownFieldExpected );
687
- #else
688
- (void )kUnknownFieldExpected ;
689
- (void )kUnknownFieldInput ;
690
- GTEST_SKIP ();
691
- #endif // GOOGLE_PROTOBUF_VERSION
692
687
}
693
688
694
689
TYPED_TEST (MutatorTypedTest, DeepRecursion) {
695
- // NOTE: This test has little chance of passing when method
696
- // TextFormat::Parser::SetRecursionLimit is not available
697
- #if GOOGLE_PROTOBUF_VERSION >= 3008000 // commit d8c2501b43c1b56e3efa74048a18f8ce06ba07fe of >=3.8.0
690
+ # if GOOGLE_PROTOBUF_VERSION < 3008000 // commit d8c2501b43c1b56e3efa74048a18f8ce06ba07fe of >=3.8.0
691
+ GTEST_SKIP () << " TextFormat::Parser::SetRecursionLimit() is not available" ;
692
+ #endif // GOOGLE_PROTOBUF_VERSION
698
693
typename TestFixture::Message message;
699
694
typename TestFixture::Message* last = &message;
700
695
for (int i = 0 ; i < 150 ; ++i) {
@@ -706,9 +701,6 @@ TYPED_TEST(MutatorTypedTest, DeepRecursion) {
706
701
EXPECT_EQ (i < 100 ,
707
702
ParseBinaryMessage (SaveMessageAsBinary (message), &parsed));
708
703
}
709
- #else
710
- GTEST_SKIP ();
711
- #endif // GOOGLE_PROTOBUF_VERSION
712
704
}
713
705
714
706
TYPED_TEST (MutatorTypedTest, EmptyMessage) {
0 commit comments