summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-01-20 00:14:19 +0100
committerLinus Groh <mail@linusgroh.de>2023-01-20 20:50:42 +0000
commit9eb040af32a660283ef35267db9dff0a64589070 (patch)
treee921ad4707632fa0b9d9dc9d726b8ed022ca6440
parentd7eead4f4c8a9b22911343e218645ead75d0fb46 (diff)
downloadserenity-9eb040af32a660283ef35267db9dff0a64589070.zip
Tests: Use `Core::Stream` to write output files in LibGL tests
-rw-r--r--Tests/LibGL/TestRender.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Tests/LibGL/TestRender.cpp b/Tests/LibGL/TestRender.cpp
index 12193ee2c3..1b7148fb2d 100644
--- a/Tests/LibGL/TestRender.cpp
+++ b/Tests/LibGL/TestRender.cpp
@@ -7,7 +7,7 @@
#include <AK/DeprecatedString.h>
#include <AK/LexicalPath.h>
-#include <LibCore/FileStream.h>
+#include <LibCore/Stream.h>
#include <LibGL/GL/gl.h>
#include <LibGL/GLContext.h>
#include <LibGfx/Bitmap.h>
@@ -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);