Classes | Namespaces | Macros
protobuf/src/google/protobuf/util/field_mask_util_test.cc File Reference
#include <google/protobuf/util/field_mask_util.h>
#include <algorithm>
#include <cstdint>
#include <vector>
#include <google/protobuf/field_mask.pb.h>
#include <google/protobuf/test_util.h>
#include <google/protobuf/unittest.pb.h>
#include <gtest/gtest.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
Include dependency graph for protobuf/src/google/protobuf/util/field_mask_util_test.cc:

Go to the source code of this file.

Classes

class  google::protobuf::util::SnakeCaseCamelCaseTest
 

Namespaces

 google
 
 google::protobuf
 
 google::protobuf::util
 

Macros

#define TEST_MERGE_ONE_FIELD(field_name)
 
#define TEST_MERGE_ONE_PRIMITIVE_FIELD(field_name)
 
#define TEST_TRIM_ONE_FIELD(field_name)
 
#define TEST_TRIM_ONE_PRIMITIVE_FIELD(field_name)
 

Macro Definition Documentation

◆ TEST_MERGE_ONE_FIELD

#define TEST_MERGE_ONE_FIELD (   field_name)
Value:
{ \
TestAllTypes tmp; \
*tmp.mutable_##field_name() = src.field_name(); \
FieldMask mask; \
mask.add_paths(#field_name); \
dst.Clear(); \
FieldMaskUtil::MergeMessageTo(src, mask, options, &dst); \
EXPECT_EQ(tmp.DebugString(), dst.DebugString()); \
}

◆ TEST_MERGE_ONE_PRIMITIVE_FIELD

#define TEST_MERGE_ONE_PRIMITIVE_FIELD (   field_name)
Value:
{ \
TestAllTypes tmp; \
tmp.set_##field_name(src.field_name()); \
FieldMask mask; \
mask.add_paths(#field_name); \
dst.Clear(); \
FieldMaskUtil::MergeMessageTo(src, mask, options, &dst); \
EXPECT_EQ(tmp.DebugString(), dst.DebugString()); \
src.clear_##field_name(); \
tmp.clear_##field_name(); \
FieldMaskUtil::MergeMessageTo(src, mask, options, &dst); \
EXPECT_EQ(tmp.DebugString(), dst.DebugString()); \
}

◆ TEST_TRIM_ONE_FIELD

#define TEST_TRIM_ONE_FIELD (   field_name)
Value:
{ \
TestAllTypes msg; \
TestAllTypes tmp; \
*tmp.mutable_##field_name() = msg.field_name(); \
FieldMask mask; \
mask.add_paths(#field_name); \
FieldMaskUtil::TrimMessage(mask, &msg); \
EXPECT_EQ(tmp.DebugString(), msg.DebugString()); \
}

◆ TEST_TRIM_ONE_PRIMITIVE_FIELD

#define TEST_TRIM_ONE_PRIMITIVE_FIELD (   field_name)
Value:
{ \
TestAllTypes msg; \
TestAllTypes tmp; \
tmp.set_##field_name(msg.field_name()); \
FieldMask mask; \
mask.add_paths(#field_name); \
FieldMaskUtil::TrimMessage(mask, &msg); \
EXPECT_EQ(tmp.DebugString(), msg.DebugString()); \
}
dst
static const char dst[]
Definition: test-fs-copyfile.c:37
options
double_dict options[]
Definition: capstone_test.c:55
tests.google.protobuf.internal.test_util.SetAllFields
def SetAllFields(message)
Definition: bloaty/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/test_util.py:182
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:12