Hi,

I am struggling with the MessageDifferencer of protobuf (version 3). I was 
hoping to use the StreamReporter::ReportModified(const Message & message1, 
const Message & message2, const std::vector< SpecificField > & field_path) to 
get the modified fields filled into the field_path vector. So I could just 
focus on those differences.

However, when I run the following code, I get a segmentation fault. I am 
not sure yet why that is.



string diff_report;
MessageDifferencer md;
md.set_report_matches(false);
md.set_report_moves(false);
md.set_scope(MessageDifferencer::FULL);
md.ReportDifferencesToString(&diff_report);
bool diff = md.Compare(msgIn01, msgIn02);
cout << "diff : " << boolalpha << diff << endl;
cout << "diff : " << diff_report << endl;

string reporterString;
google::protobuf::io::StringOutputStream sos(&reporterString);
MessageDifferencer::StreamReporter reporter(&sos);
std::vector< MessageDifferencer::SpecificField > field_path;
md.ReportDifferencesTo(&reporter);
reporter.ReportMatched(msgIn01, msgIn02, field_path);


The output I get is showing this :


diff : false
diff : modified: msg.send.settings.Scan.Frames[0].txFstop: 0.5 -> 2.5


Program received signal SIGSEGV, Segmentation fault.




-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to