| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // In the unit-tests we want to test two scenarios: one with type info from | 58 // In the unit-tests we want to test two scenarios: one with type info from |
| 59 // ServiceTypeInfo, the other with type info from TypeResolver. This class | 59 // ServiceTypeInfo, the other with type info from TypeResolver. This class |
| 60 // wraps the detail of where the type info is from and provides the same | 60 // wraps the detail of where the type info is from and provides the same |
| 61 // interface so the same unit-test code can test both scenarios. | 61 // interface so the same unit-test code can test both scenarios. |
| 62 class TypeInfoTestHelper { | 62 class TypeInfoTestHelper { |
| 63 public: | 63 public: |
| 64 explicit TypeInfoTestHelper(TypeInfoSource type) : type_(type) {} | 64 explicit TypeInfoTestHelper(TypeInfoSource type) : type_(type) {} |
| 65 | 65 |
| 66 // Creates a TypeInfo object for the given set of descriptors. | 66 // Creates a TypeInfo object for the given set of descriptors. |
| 67 void ResetTypeInfo(const vector<const Descriptor*>& descriptors); | 67 void ResetTypeInfo(const std::vector<const Descriptor*>& descriptors); |
| 68 | 68 |
| 69 // Convinent overloads. | 69 // Convinent overloads. |
| 70 void ResetTypeInfo(const Descriptor* descriptor); | 70 void ResetTypeInfo(const Descriptor* descriptor); |
| 71 void ResetTypeInfo(const Descriptor* descriptor1, | 71 void ResetTypeInfo(const Descriptor* descriptor1, |
| 72 const Descriptor* descriptor2); | 72 const Descriptor* descriptor2); |
| 73 | 73 |
| 74 // Returns the TypeInfo created after ResetTypeInfo. | 74 // Returns the TypeInfo created after ResetTypeInfo. |
| 75 TypeInfo* GetTypeInfo(); | 75 TypeInfo* GetTypeInfo(); |
| 76 | 76 |
| 77 ProtoStreamObjectSource* NewProtoSource(io::CodedInputStream* coded_input, | 77 ProtoStreamObjectSource* NewProtoSource(io::CodedInputStream* coded_input, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 89 google::protobuf::scoped_ptr<TypeInfo> typeinfo_; | 89 google::protobuf::scoped_ptr<TypeInfo> typeinfo_; |
| 90 google::protobuf::scoped_ptr<TypeResolver> type_resolver_; | 90 google::protobuf::scoped_ptr<TypeResolver> type_resolver_; |
| 91 }; | 91 }; |
| 92 } // namespace testing | 92 } // namespace testing |
| 93 } // namespace converter | 93 } // namespace converter |
| 94 } // namespace util | 94 } // namespace util |
| 95 } // namespace protobuf | 95 } // namespace protobuf |
| 96 | 96 |
| 97 } // namespace google | 97 } // namespace google |
| 98 #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_TYPE_INFO_TEST_HELPER_H__ | 98 #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_TYPE_INFO_TEST_HELPER_H__ |
| OLD | NEW |