diff options
author | Brendan Coles <bcoles@gmail.com> | 2020-11-14 23:18:39 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-15 00:50:57 +0100 |
commit | d739483ee8fc8addc7d17697e9c2d058a2619835 (patch) | |
tree | 4df4e22f5127d7ca5fe1a9e12b84b352d137a5f2 /Userland/test-gfx-font.cpp | |
parent | 12d923bb7eeb99a116ef15084fa19959ec236ddb (diff) | |
download | serenity-d739483ee8fc8addc7d17697e9c2d058a2619835.zip |
Userland: Tests: Use mkstemp temporary files in tests
Diffstat (limited to 'Userland/test-gfx-font.cpp')
-rw-r--r-- | Userland/test-gfx-font.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/test-gfx-font.cpp b/Userland/test-gfx-font.cpp index ccb0fd7e4b..151d8cea11 100644 --- a/Userland/test-gfx-font.cpp +++ b/Userland/test-gfx-font.cpp @@ -137,9 +137,10 @@ static void test_write_to_file() u8 glyph_width = 1; auto font = Gfx::Font::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); - const char* font_path = "/tmp/new.font"; - assert(font->write_to_file(font_path)); - unlink(font_path); + char path[] = "/tmp/new.font.XXXXXX"; + assert(mkstemp(path) != -1); + assert(font->write_to_file(path)); + unlink(path); } int main(int, char**) |