mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Tests: Use Core::Stream
to write output files in LibGL tests
This commit is contained in:
parent
d7eead4f4c
commit
9eb040af32
1 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue