| 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 | |
| 147 | TEST_F(FieldTest, supportsInt32) { |
nothing calls this directly
no test coverage detected