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> | |
50 #include <google/protobuf/dynamic_message.h> | 48 #include <google/protobuf/dynamic_message.h> |
51 #include <google/protobuf/descriptor.h> | 49 #include <google/protobuf/descriptor.h> |
52 #include <google/protobuf/descriptor.pb.h> | 50 #include <google/protobuf/descriptor.pb.h> |
53 #include <google/protobuf/test_util.h> | 51 #include <google/protobuf/test_util.h> |
54 #include <google/protobuf/unittest.pb.h> | 52 #include <google/protobuf/unittest.pb.h> |
55 #include <google/protobuf/unittest_no_field_presence.pb.h> | 53 #include <google/protobuf/unittest_no_field_presence.pb.h> |
56 | 54 |
57 #include <google/protobuf/stubs/logging.h> | 55 #include <google/protobuf/stubs/logging.h> |
| 56 #include <google/protobuf/stubs/common.h> |
58 #include <google/protobuf/testing/googletest.h> | 57 #include <google/protobuf/testing/googletest.h> |
59 #include <gtest/gtest.h> | 58 #include <gtest/gtest.h> |
60 | 59 |
61 namespace google { | 60 namespace google { |
62 namespace protobuf { | 61 namespace protobuf { |
63 | 62 |
64 class DynamicMessageTest : public testing::Test { | 63 class DynamicMessageTest : public testing::Test { |
65 protected: | 64 protected: |
66 DescriptorPool pool_; | 65 DescriptorPool pool_; |
67 DynamicMessageFactory factory_; | 66 DynamicMessageFactory factory_; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 282 |
284 // Also ensure that the default instance handles field presence properly. | 283 // Also ensure that the default instance handles field presence properly. |
285 EXPECT_EQ(false, refl->HasField(*proto3_prototype_, optional_msg)); | 284 EXPECT_EQ(false, refl->HasField(*proto3_prototype_, optional_msg)); |
286 | 285 |
287 delete message; | 286 delete message; |
288 } | 287 } |
289 | 288 |
290 | 289 |
291 } // namespace protobuf | 290 } // namespace protobuf |
292 } // namespace google | 291 } // namespace google |
OLD | NEW |