Add a comparison operator and .clear_X() to proto_to_cpp

R=primiano@google.com

Change-Id: I818e07fd065bd069bee489263b56574a43a861fd
diff --git a/src/tracing/core/test_config.cc b/src/tracing/core/test_config.cc
index 8797261..582128a 100644
--- a/src/tracing/core/test_config.cc
+++ b/src/tracing/core/test_config.cc
@@ -38,6 +38,17 @@
 TestConfig::TestConfig(TestConfig&&) noexcept = default;
 TestConfig& TestConfig::operator=(TestConfig&&) = default;
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+bool TestConfig::operator==(const TestConfig& other) const {
+  return (message_count_ == other.message_count_) &&
+         (max_messages_per_second_ == other.max_messages_per_second_) &&
+         (seed_ == other.seed_) && (message_size_ == other.message_size_) &&
+         (send_batch_on_register_ == other.send_batch_on_register_) &&
+         (dummy_fields_ == other.dummy_fields_);
+}
+#pragma GCC diagnostic pop
+
 void TestConfig::FromProto(const perfetto::protos::TestConfig& proto) {
   static_assert(sizeof(message_count_) == sizeof(proto.message_count()),
                 "size mismatch");
@@ -110,6 +121,27 @@
 TestConfig::DummyFields& TestConfig::DummyFields::operator=(
     TestConfig::DummyFields&&) = default;
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+bool TestConfig::DummyFields::operator==(
+    const TestConfig::DummyFields& other) const {
+  return (field_uint32_ == other.field_uint32_) &&
+         (field_int32_ == other.field_int32_) &&
+         (field_uint64_ == other.field_uint64_) &&
+         (field_int64_ == other.field_int64_) &&
+         (field_fixed64_ == other.field_fixed64_) &&
+         (field_sfixed64_ == other.field_sfixed64_) &&
+         (field_fixed32_ == other.field_fixed32_) &&
+         (field_sfixed32_ == other.field_sfixed32_) &&
+         (field_double_ == other.field_double_) &&
+         (field_float_ == other.field_float_) &&
+         (field_sint64_ == other.field_sint64_) &&
+         (field_sint32_ == other.field_sint32_) &&
+         (field_string_ == other.field_string_) &&
+         (field_bytes_ == other.field_bytes_);
+}
+#pragma GCC diagnostic pop
+
 void TestConfig::DummyFields::FromProto(
     const perfetto::protos::TestConfig_DummyFields& proto) {
   static_assert(sizeof(field_uint32_) == sizeof(proto.field_uint32()),