aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/dynamic_message_unittest.cc
diff options
context:
space:
mode:
authorGravatar temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2008-08-13 03:15:00 +0000
committerGravatar temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2008-08-13 03:15:00 +0000
commit779f61c6a3ce02a119e28e802f229e61b69b9046 (patch)
tree9131ef5f0acdc3d708a795fc6703488674741ee0 /src/google/protobuf/dynamic_message_unittest.cc
parenta0f27fcd96c5bf2509ca88cca54f00b78f7b8bc5 (diff)
Integrate recent changes from google3.
protoc - New flags --encode and --decode can be used to convert between protobuf text format and binary format from the command-line. - New flag --descriptor_set_out can be used to write FileDescriptorProtos for all parsed files directly into a single output file. This is particularly useful if you wish to parse .proto files from programs written in languages other than C++: just run protoc as a background process and have it output a FileDescriptorList, then parse that natively. C++ - Reflection objects are now per-class rather than per-instance. To make this possible, the Reflection interface had to be changed such that all methods take the Message instance as a parameter. This change improves performance significantly in memory-bandwidth-limited use cases, since it makes the message objects smaller. Note that source-incompatible interface changes like this will not be made again after the library leaves beta. Python - MergeFrom(message) and CopyFrom(message) are now implemented. - SerializeToString() raises an exception if the message is missing required fields. - Code organization improvements. - Fixed doc comments for RpcController and RpcChannel, which had somehow been swapped.
Diffstat (limited to 'src/google/protobuf/dynamic_message_unittest.cc')
-rw-r--r--src/google/protobuf/dynamic_message_unittest.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/google/protobuf/dynamic_message_unittest.cc b/src/google/protobuf/dynamic_message_unittest.cc
index 5afac1fc..f7ed51f4 100644
--- a/src/google/protobuf/dynamic_message_unittest.cc
+++ b/src/google/protobuf/dynamic_message_unittest.cc
@@ -90,7 +90,7 @@ TEST_F(DynamicMessageTest, OnePrototype) {
TEST_F(DynamicMessageTest, Defaults) {
// Check that all default values are set correctly in the initial message.
TestUtil::ReflectionTester reflection_tester(descriptor_);
- reflection_tester.ExpectClearViaReflection(*prototype_->GetReflection());
+ reflection_tester.ExpectClearViaReflection(*prototype_);
}
TEST_F(DynamicMessageTest, IndependentOffsets) {
@@ -100,8 +100,8 @@ TEST_F(DynamicMessageTest, IndependentOffsets) {
scoped_ptr<Message> message(prototype_->New());
TestUtil::ReflectionTester reflection_tester(descriptor_);
- reflection_tester.SetAllFieldsViaReflection(message->GetReflection());
- reflection_tester.ExpectAllFieldsSetViaReflection(*message->GetReflection());
+ reflection_tester.SetAllFieldsViaReflection(message.get());
+ reflection_tester.ExpectAllFieldsSetViaReflection(*message);
}
TEST_F(DynamicMessageTest, Extensions) {
@@ -109,8 +109,8 @@ TEST_F(DynamicMessageTest, Extensions) {
scoped_ptr<Message> message(extensions_prototype_->New());
TestUtil::ReflectionTester reflection_tester(extensions_descriptor_);
- reflection_tester.SetAllFieldsViaReflection(message->GetReflection());
- reflection_tester.ExpectAllFieldsSetViaReflection(*message->GetReflection());
+ reflection_tester.SetAllFieldsViaReflection(message.get());
+ reflection_tester.ExpectAllFieldsSetViaReflection(*message);
}
} // namespace protobuf