Commits


Konstantin Varlamov authored and GitHub committed d0686d2f631
C++ migration: implement pretty-printing of Nanopb-generated messages (#4184) Note: the output is indistinguishable from what is generated by the Objective-C library, with two exceptions: * class names are different (due to using prefixes, e.g., `GCFS`); * order in which map fields are outputted can be different (which I presume is to be expected). I verified this by running integration tests and using simple diffing code to compare outputs: in the destructor of each `Message<T>` (if it's not moved-from), serialize the `Message` to bytes, create an Objective-C proto out of those bytes, convert both protos to their string form, compare the strings (ignoring minor differences in indentation, etc.). Out of 5.7K comparisons, there were just two cases of differences: * one was in `SerializerTest.FailOnInvalidInputBytes`; since the input in question is invalid, this doesn't seem to require much attention; * another one was due to differing floating point precision: C++ produces `1.79769e+308` while Objective-C produces `1.79769313486232e+308`. Added a TODO. Example output: ``` 2019-10-28 21:44:56.941749-0400 Firestore_Example_iOS[78883:2094242] 6.11.0 - [Firebase/Firestore][I-FST000001] WriteStream (7f903ca53d50) write request: <WriteRequest 0x70000991ef08>: { writes { update { name: "projects/varconst-11-a51fd/databases/(default)/documents/test-collection/u6QizHeYjqt8Xe61kBoi" fields { key: "key" value { string_value: "value" } } } } stream_token: "\031\020hB\002\201\364\265\265" } ```