aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2014-12-03 12:12:17 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2014-12-03 12:12:17 -0800
commit58dfce93847ece9ae05e70091f982b8882fd3c16 (patch)
tree220da0e7ca3a605c2930f00f0cea93c6e8fdb609
parent81a630c66e23ef513a7cb585ea203bff11cc4167 (diff)
Update version number in descriptor.pb.h and plugin.pb.h. Protect death
tests with macro PROTOBUF_HAS_DEATH_TEST.
-rw-r--r--src/google/protobuf/compiler/plugin.pb.h4
-rw-r--r--src/google/protobuf/descriptor.pb.h4
-rw-r--r--src/google/protobuf/map_test.cc2
-rw-r--r--src/google/protobuf/repeated_field_reflection_unittest.cc2
4 files changed, 8 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
index 35a0a899..ad017005 100644
--- a/src/google/protobuf/compiler/plugin.pb.h
+++ b/src/google/protobuf/compiler/plugin.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 2006000
+#if GOOGLE_PROTOBUF_VERSION < 3000000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 2006002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h
index 6bb5c6a6..cda25982 100644
--- a/src/google/protobuf/descriptor.pb.h
+++ b/src/google/protobuf/descriptor.pb.h
@@ -8,12 +8,12 @@
#include <google/protobuf/stubs/common.h>
-#if GOOGLE_PROTOBUF_VERSION < 2006000
+#if GOOGLE_PROTOBUF_VERSION < 3000000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 2006002 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
diff --git a/src/google/protobuf/map_test.cc b/src/google/protobuf/map_test.cc
index c680ccb2..9db67523 100644
--- a/src/google/protobuf/map_test.cc
+++ b/src/google/protobuf/map_test.cc
@@ -190,6 +190,7 @@ TEST_F(MapImplTest, MutableAt) {
ExpectSingleElement(key, value2);
}
+#ifdef PROTOBUF_HAS_DEATH_TEST
TEST_F(MapImplTest, MutableAtNonExistDeathTest) {
EXPECT_DEATH(map_.at(0), "");
}
@@ -197,6 +198,7 @@ TEST_F(MapImplTest, MutableAtNonExistDeathTest) {
TEST_F(MapImplTest, ImmutableAtNonExistDeathTest) {
EXPECT_DEATH(const_map_.at(0), "");
}
+#endif // PROTOBUF_HAS_DEATH_TEST
TEST_F(MapImplTest, CountNonExist) {
EXPECT_EQ(0, map_.count(0));
diff --git a/src/google/protobuf/repeated_field_reflection_unittest.cc b/src/google/protobuf/repeated_field_reflection_unittest.cc
index ae43dfab..00252674 100644
--- a/src/google/protobuf/repeated_field_reflection_unittest.cc
+++ b/src/google/protobuf/repeated_field_reflection_unittest.cc
@@ -410,6 +410,7 @@ TEST(RepeatedFieldReflectionTest, RepeatedFieldRefForRegularFields) {
EXPECT_TRUE(rf_message.empty());
EXPECT_TRUE(mrf_message.empty());
+#ifdef PROTOBUF_HAS_DEATH_TEST
// Make sure types are checked correctly at runtime.
const FieldDescriptor* fd_optional_int32 =
desc->FindFieldByName("optional_int32");
@@ -419,6 +420,7 @@ TEST(RepeatedFieldReflectionTest, RepeatedFieldRefForRegularFields) {
message, fd_repeated_int32), "");
EXPECT_DEATH(refl->GetRepeatedFieldRef<TestAllTypes>(
message, fd_repeated_foreign_message), "");
+#endif // PROTOBUF_HAS_DEATH_TEST
}
TEST(RepeatedFieldReflectionTest, RepeatedFieldRefForEnums) {