Tests: Remove some temporary files when finished using them

Leaving files in /tmp uses memory, which accumulates over time if you do
something weird like leaving `run-tests` going all day long. :^)
This commit is contained in:
Andreas Kling 2022-01-14 00:20:01 +01:00
parent 0e08763483
commit 4d0abf82ed
Notes: sideshowbarker 2024-07-17 20:55:43 +09:00
2 changed files with 5 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include <AK/StringBuilder.h>
#include <AK/Vector.h>
#include <math.h>
#include <unistd.h>
TEST_CASE(is_integral_works_properly)
{
@ -232,6 +233,8 @@ TEST_CASE(file_descriptor)
EXPECT_EQ("Hello, World!\nfoobar\n"sv, StringView { buffer.span().trim(nread) });
fclose(file);
unlink(filename);
}
TEST_CASE(floating_point_numbers)

View file

@ -35,6 +35,7 @@ TEST_CASE(file_readline)
file->close();
outputfile->close();
VERIFY(files_have_same_contents(path, output_path));
unlink(output_path);
}
TEST_CASE(file_get_read_position)
@ -88,4 +89,5 @@ TEST_CASE(file_lines_range)
file->close();
outputfile->close();
VERIFY(files_have_same_contents(path, output_path));
unlink(output_path);
}