Skip to content

Commit

Permalink
[test]: Skip test function if test input is empty (envoyproxy#32201)
Browse files Browse the repository at this point in the history
This fix addresses an issue with a test only ASSERT that occurs when the test input is empty, i.e. there is nothing to replay.

Signed-off-by: Yan Avlasov <[email protected]>
  • Loading branch information
yanavlasov authored Feb 6, 2024
1 parent 0a54177 commit 77f9577
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/integration/h1_capture_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ namespace Envoy {
void H1FuzzIntegrationTest::initialize() { HttpIntegrationTest::initialize(); }

DEFINE_PROTO_FUZZER(const test::integration::CaptureFuzzTestCase& input) {
if (input.events_size() == 0) {
return;
}
// Pick an IP version to use for loopback, it doesn't matter which.
RELEASE_ASSERT(!TestEnvironment::getIpVersionsForTest().empty(), "");
const auto ip_version = TestEnvironment::getIpVersionsForTest()[0];
Expand Down

0 comments on commit 77f9577

Please sign in to comment.