diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-06-25 19:05:36 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-06-25 19:05:36 +0000 |
commit | ceb561d65bfe234a301979a7e3f7ddc244d349b3 (patch) | |
tree | 8b86ec6fda6f7bcce0f214940dcaea5fb73c7d9f /src/google/protobuf/test_util.h | |
parent | f22943c7d0ce19b35a1e3d7f33c8ede3b6fed485 (diff) |
Add Swap(), SwapElements(), and RemoveLast() to Reflection. Patch by Scott Stafford.
Diffstat (limited to 'src/google/protobuf/test_util.h')
-rw-r--r-- | src/google/protobuf/test_util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/google/protobuf/test_util.h b/src/google/protobuf/test_util.h index 1bedb788..e581f419 100644 --- a/src/google/protobuf/test_util.h +++ b/src/google/protobuf/test_util.h @@ -96,6 +96,17 @@ class TestUtil { // SetAllFieldsAndExtensions(). static void ExpectAllFieldsAndExtensionsInOrder(const string& serialized); + // Check that all repeated fields have had their last elements removed. + static void ExpectLastRepeatedsRemoved( + const unittest::TestAllTypes& message); + static void ExpectLastRepeatedExtensionsRemoved( + const unittest::TestAllExtensions& message); + + // Check that all repeated fields have had their first and last elements swapped. + static void ExpectRepeatedsSwapped(const unittest::TestAllTypes& message); + static void ExpectRepeatedExtensionsSwapped( + const unittest::TestAllExtensions& message); + // Like above, but use the reflection interface. class ReflectionTester { public: @@ -116,6 +127,9 @@ class TestUtil { void ExpectPackedFieldsSetViaReflection(const Message& message); void ExpectPackedClearViaReflection(const Message& message); + void RemoveLastRepeatedsViaReflection(Message* message); + void SwapRepeatedsViaReflection(Message* message); + private: const FieldDescriptor* F(const string& name); |