OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 27 matching lines...) Expand all Loading... |
38 // GenericMessageReflection needs to use. So, we focus on that in this | 38 // GenericMessageReflection needs to use. So, we focus on that in this |
39 // test. Other tests, such as generic_message_reflection_unittest and | 39 // test. Other tests, such as generic_message_reflection_unittest and |
40 // reflection_ops_unittest, cover the rest of the functionality used by | 40 // reflection_ops_unittest, cover the rest of the functionality used by |
41 // DynamicMessage. | 41 // DynamicMessage. |
42 | 42 |
43 #include <memory> | 43 #include <memory> |
44 #ifndef _SHARED_PTR_H | 44 #ifndef _SHARED_PTR_H |
45 #include <google/protobuf/stubs/shared_ptr.h> | 45 #include <google/protobuf/stubs/shared_ptr.h> |
46 #endif | 46 #endif |
47 | 47 |
| 48 #include <google/protobuf/stubs/scoped_ptr.h> |
| 49 #include <google/protobuf/stubs/common.h> |
48 #include <google/protobuf/dynamic_message.h> | 50 #include <google/protobuf/dynamic_message.h> |
49 #include <google/protobuf/descriptor.h> | 51 #include <google/protobuf/descriptor.h> |
50 #include <google/protobuf/descriptor.pb.h> | 52 #include <google/protobuf/descriptor.pb.h> |
51 #include <google/protobuf/test_util.h> | 53 #include <google/protobuf/test_util.h> |
52 #include <google/protobuf/unittest.pb.h> | 54 #include <google/protobuf/unittest.pb.h> |
53 #include <google/protobuf/unittest_no_field_presence.pb.h> | 55 #include <google/protobuf/unittest_no_field_presence.pb.h> |
54 | 56 |
55 #include <google/protobuf/stubs/logging.h> | 57 #include <google/protobuf/stubs/logging.h> |
56 #include <google/protobuf/stubs/common.h> | |
57 #include <google/protobuf/testing/googletest.h> | 58 #include <google/protobuf/testing/googletest.h> |
58 #include <gtest/gtest.h> | 59 #include <gtest/gtest.h> |
59 | 60 |
60 namespace google { | 61 namespace google { |
61 namespace protobuf { | 62 namespace protobuf { |
62 | 63 |
63 class DynamicMessageTest : public testing::Test { | 64 class DynamicMessageTest : public testing::Test { |
64 protected: | 65 protected: |
65 DescriptorPool pool_; | 66 DescriptorPool pool_; |
66 DynamicMessageFactory factory_; | 67 DynamicMessageFactory factory_; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 283 |
283 // Also ensure that the default instance handles field presence properly. | 284 // Also ensure that the default instance handles field presence properly. |
284 EXPECT_EQ(false, refl->HasField(*proto3_prototype_, optional_msg)); | 285 EXPECT_EQ(false, refl->HasField(*proto3_prototype_, optional_msg)); |
285 | 286 |
286 delete message; | 287 delete message; |
287 } | 288 } |
288 | 289 |
289 | 290 |
290 } // namespace protobuf | 291 } // namespace protobuf |
291 } // namespace google | 292 } // namespace google |
OLD | NEW |