test: Don't reuse on-stack input stream

The test consists of several snippets, each creating an input_stream for
some short operation and checking the result. Each snipped over-writes
the local `input_stream in` variable with the new one.

This change wraps each of those snippets into own code block in order to
have own new `input_stream in` variable in each.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2025-10-28 19:11:24 +03:00
parent 81f598225e
commit 37b9cccc1c

View File

@@ -692,36 +692,48 @@ SEASTAR_TEST_CASE(test_skipping_in_compressed_stream) {
BOOST_REQUIRE(b.empty());
};
{
auto in = make_is();
expect(in, buf1);
expect(in, buf2);
expect_eof(in);
}
in = make_is();
{
auto in = make_is();
in.skip(0).get();
expect(in, buf1);
expect(in, buf2);
expect_eof(in);
}
in = make_is();
{
auto in = make_is();
expect(in, buf1);
in.skip(0).get();
expect(in, buf2);
expect_eof(in);
}
in = make_is();
{
auto in = make_is();
expect(in, buf1);
in.skip(opts.buffer_size).get();
expect_eof(in);
}
in = make_is();
{
auto in = make_is();
in.skip(opts.buffer_size * 2).get();
expect_eof(in);
}
in = make_is();
{
auto in = make_is();
in.skip(opts.buffer_size).get();
in.skip(opts.buffer_size).get();
expect_eof(in);
}
});
}