0

My goal is to compare some fields in protobuf messages. I have tried MessageDifferencer, but I don't want to use reflection. I'm using protobuf 3.4.0.

Time variables are stored in protobuf's well-known types like google.protobuf.Duration and google.protobuf.Timestamp.

I would like to use a macro which takes two objects and a field name:

CHECK_GPS_TIME ( expectedGps, storedGps, gps_time );

I'm expecting the following result:

CHECK ( expectedGps.gps_time().seconds() == storedGps.gps_time().seconds() );

I already have a macro for simple types:

#define CHECK_GPS_FIELD(expected, stored, field) CHECK( expected.field() == stored.field() );
Jónás Balázs
  • 781
  • 10
  • 24

0 Answers0