MCPcopy Create free account
hub / github.com/Snapchat/Valdi / testField

Method testField

valdi_protobuf/test/Field_tests.cpp:129–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128 template<typename T>
129 void testField(T fieldValue,
130 void (Protobuf::Field::*setter)(T),
131 T (Protobuf::Field::*getter)() const,
132 void (*pbWriter)(int, T, google::protobuf::io::CodedOutputStream*)) {
133 (field.*setter)(fieldValue);
134
135 auto result = (field.*getter)();
136
137 ASSERT_EQ(fieldValue, result);
138
139 testEncode([&](int fieldIndex, google::protobuf::io::CodedOutputStream* outputStream) {
140 if (!isFieldZero(fieldValue)) {
141 pbWriter(fieldIndex, fieldValue, outputStream);
142 }
143 });
144 }
145};
146
147TEST_F(FieldTest, supportsInt32) {

Callers

nothing calls this directly

Calls 1

isFieldZeroFunction · 0.85

Tested by

no test coverage detected