Skip to content

Add safe proto diff helper #433

@eric846

Description

@eric846

Need to do this separately after test/adaptive_load/utility.h goes in.

The helper should do:
EXPECT_EQ(message->DebugString(), expected_config.DebugString());
EXPECT_TRUE(Envoy::MessageUtil()(*message, expected_config));

oschaaf:
I learned that with proto3 default values may not get serialised. I'm not 100% sure that equivalence here guarantees actual equivalence with respect to set/not-set/default-value. Therefore, to make sure no edge cases slip past, maybe it makes sense to also double down with MessageUtil()(message1, message1). This won't produce a helpful test message, so I'd put it after comparing the debug strings (which should produce a nice diff), maybe in a helper method.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions