Index: third_party/protobuf/src/google/protobuf/test_util_lite.cc |
diff --git a/third_party/protobuf/src/google/protobuf/test_util_lite.cc b/third_party/protobuf/src/google/protobuf/test_util_lite.cc |
index 9099292ab1bb7bac1e9930e649b12acf54260bec..388c0cbde20517ea141e7da61a268062a687d6c1 100644 |
--- a/third_party/protobuf/src/google/protobuf/test_util_lite.cc |
+++ b/third_party/protobuf/src/google/protobuf/test_util_lite.cc |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -33,6 +33,7 @@ |
// Sanjay Ghemawat, Jeff Dean, and others. |
#include <google/protobuf/test_util_lite.h> |
+#include <google/protobuf/stubs/logging.h> |
#include <google/protobuf/stubs/common.h> |
@@ -153,6 +154,11 @@ void TestUtilLite::SetAllFields(unittest::TestAllTypesLite* message) { |
message->set_default_foreign_enum(unittest::FOREIGN_LITE_FOO ); |
message->set_default_import_enum (unittest_import::IMPORT_LITE_FOO); |
+ |
+ message->set_oneof_uint32(601); |
+ message->mutable_oneof_nested_message()->set_bb(602); |
+ message->set_oneof_string("603"); |
+ message->set_oneof_bytes("604"); |
} |
// ------------------------------------------------------------------- |
@@ -378,6 +384,13 @@ void TestUtilLite::ExpectAllFieldsSet( |
EXPECT_EQ(unittest::FOREIGN_LITE_FOO , message.default_foreign_enum()); |
EXPECT_EQ(unittest_import::IMPORT_LITE_FOO, message.default_import_enum ()); |
+ |
+ EXPECT_FALSE(message.has_oneof_uint32 ()); |
+ EXPECT_FALSE(message.has_oneof_nested_message()); |
+ EXPECT_FALSE(message.has_oneof_string ()); |
+ EXPECT_TRUE(message.has_oneof_bytes ()); |
+ |
+ EXPECT_EQ("604", message.oneof_bytes()); |
} |
// ------------------------------------------------------------------- |
@@ -518,6 +531,11 @@ void TestUtilLite::ExpectClear(const unittest::TestAllTypesLite& message) { |
EXPECT_EQ(unittest::FOREIGN_LITE_BAR , message.default_foreign_enum()); |
EXPECT_EQ(unittest_import::IMPORT_LITE_BAR, message.default_import_enum ()); |
+ |
+ EXPECT_FALSE(message.has_oneof_uint32 ()); |
+ EXPECT_FALSE(message.has_oneof_nested_message()); |
+ EXPECT_FALSE(message.has_oneof_string ()); |
+ EXPECT_FALSE(message.has_oneof_bytes ()); |
} |
// ------------------------------------------------------------------- |
@@ -900,6 +918,11 @@ void TestUtilLite::SetAllExtensions(unittest::TestAllExtensionsLite* message) { |
message->SetExtension(unittest::default_foreign_enum_extension_lite, unittest::FOREIGN_LITE_FOO ); |
message->SetExtension(unittest::default_import_enum_extension_lite , unittest_import::IMPORT_LITE_FOO); |
+ |
+ message->SetExtension(unittest::oneof_uint32_extension_lite, 601); |
+ message->MutableExtension(unittest::oneof_nested_message_extension_lite)->set_bb(602);; |
+ message->SetExtension(unittest::oneof_string_extension_lite, "603"); |
+ message->SetExtension(unittest::oneof_bytes_extension_lite, "604"); |
} |
// ------------------------------------------------------------------- |
@@ -1126,6 +1149,16 @@ void TestUtilLite::ExpectAllExtensionsSet( |
EXPECT_EQ(unittest::FOREIGN_LITE_FOO , message.GetExtension(unittest::default_foreign_enum_extension_lite)); |
EXPECT_EQ(unittest_import::IMPORT_LITE_FOO, message.GetExtension(unittest::default_import_enum_extension_lite )); |
+ |
+ EXPECT_TRUE(message.HasExtension(unittest::oneof_uint32_extension_lite)); |
+ EXPECT_TRUE(message.GetExtension(unittest::oneof_nested_message_extension_lite).has_bb()); |
+ EXPECT_TRUE(message.HasExtension(unittest::oneof_string_extension_lite)); |
+ EXPECT_TRUE(message.HasExtension(unittest::oneof_bytes_extension_lite)); |
+ |
+ EXPECT_EQ(601, message.GetExtension(unittest::oneof_uint32_extension_lite)); |
+ EXPECT_EQ(602, message.GetExtension(unittest::oneof_nested_message_extension_lite).bb()); |
+ EXPECT_EQ("603", message.GetExtension(unittest::oneof_string_extension_lite)); |
+ EXPECT_EQ("604", message.GetExtension(unittest::oneof_bytes_extension_lite)); |
} |
// ------------------------------------------------------------------- |
@@ -1274,6 +1307,11 @@ void TestUtilLite::ExpectExtensionsClear( |
EXPECT_EQ(unittest::FOREIGN_LITE_BAR , message.GetExtension(unittest::default_foreign_enum_extension_lite)); |
EXPECT_EQ(unittest_import::IMPORT_LITE_BAR, message.GetExtension(unittest::default_import_enum_extension_lite )); |
+ |
+ EXPECT_FALSE(message.HasExtension(unittest::oneof_uint32_extension_lite)); |
+ EXPECT_FALSE(message.GetExtension(unittest::oneof_nested_message_extension_lite).has_bb()); |
+ EXPECT_FALSE(message.HasExtension(unittest::oneof_string_extension_lite)); |
+ EXPECT_FALSE(message.HasExtension(unittest::oneof_bytes_extension_lite)); |
} |
// ------------------------------------------------------------------- |