From 9eb040af32a660283ef35267db9dff0a64589070 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 20 Jan 2023 00:14:19 +0100 Subject: [PATCH] Tests: Use `Core::Stream` to write output files in LibGL tests --- Tests/LibGL/TestRender.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Tests/LibGL/TestRender.cpp b/Tests/LibGL/TestRender.cpp index 12193ee2c38..1b7148fb2d7 100644 --- a/Tests/LibGL/TestRender.cpp +++ b/Tests/LibGL/TestRender.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -36,10 +36,8 @@ static void expect_bitmap_equals_reference(Gfx::Bitmap const& bitmap, StringView if constexpr (SAVE_OUTPUT) { auto target_path = LexicalPath("/home/anon").append(reference_filename); auto qoi_buffer = Gfx::QOIWriter::encode(bitmap); - auto qoi_output_stream = MUST(Core::OutputFileStream::open(target_path.string())); - auto number_of_bytes_written = qoi_output_stream.write(qoi_buffer); - qoi_output_stream.close(); - EXPECT_EQ(number_of_bytes_written, qoi_buffer.size()); + auto qoi_output_stream = MUST(Core::Stream::File::open(target_path.string(), Core::Stream::OpenMode::Write)); + MUST(qoi_output_stream->write_entire_buffer(qoi_buffer)); } auto reference_image_path = DeprecatedString::formatted(REFERENCE_IMAGE_DIR "/{}", reference_filename);