1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2008 Google Inc. All rights reserved. 3 // 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file or at 6 // https://developers.google.com/open-source/licenses/bsd 7 8 #ifndef GOOGLE_PROTOBUF_MAP_LITE_TEST_UTIL_H__ 9 #define GOOGLE_PROTOBUF_MAP_LITE_TEST_UTIL_H__ 10 11 #include "google/protobuf/map_lite_unittest.pb.h" 12 13 namespace google { 14 namespace protobuf { 15 16 class MapLiteTestUtil { 17 public: 18 // Set every field in the TestMapLite message to a unique value. 19 static void SetMapFields(protobuf_unittest::TestMapLite* message); 20 21 // Set every field in the TestArenaMapLite message to a unique value. 22 static void SetArenaMapFields(protobuf_unittest::TestArenaMapLite* message); 23 24 // Set every field in the message to a default value. 25 static void SetMapFieldsInitialized(protobuf_unittest::TestMapLite* message); 26 27 // Modify all the map fields of the message (which should already have been 28 // initialized with SetMapFields()). 29 static void ModifyMapFields(protobuf_unittest::TestMapLite* message); 30 31 // Check that all fields have the values that they should have after 32 // SetMapFields() is called. 33 static void ExpectMapFieldsSet(const protobuf_unittest::TestMapLite& message); 34 35 // Check that all fields have the values that they should have after 36 // SetMapFields() is called for TestArenaMapLite. 37 static void ExpectArenaMapFieldsSet( 38 const protobuf_unittest::TestArenaMapLite& message); 39 40 // Check that all fields have the values that they should have after 41 // SetMapFieldsInitialized() is called. 42 static void ExpectMapFieldsSetInitialized( 43 const protobuf_unittest::TestMapLite& message); 44 45 // Expect that the message is modified as would be expected from 46 // ModifyMapFields(). 47 static void ExpectMapFieldsModified( 48 const protobuf_unittest::TestMapLite& message); 49 50 // Check that all fields are empty. 51 static void ExpectClear(const protobuf_unittest::TestMapLite& message); 52 }; 53 54 } // namespace protobuf 55 } // namespace google 56 57 #endif // GOOGLE_PROTOBUF_MAP_LITE_TEST_UTIL_H__ 58