From f00f68ef6fcb961e548ac4b685245e7b9b5bd7de Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Fri, 2 Aug 2024 22:09:04 +0200 Subject: [PATCH] posix/os2: fix test and add back in removed temp guard --- core/os/os2/stat_windows.odin | 2 ++ tests/core/sys/posix/posix.odin | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/os/os2/stat_windows.odin b/core/os/os2/stat_windows.odin index 46505bfb7..5b59f4269 100644 --- a/core/os/os2/stat_windows.odin +++ b/core/os/os2/stat_windows.odin @@ -147,6 +147,8 @@ _cleanpath_from_handle_u16 :: proc(f: ^File) -> ([]u16, Error) { return nil, _get_platform_error() } + TEMP_ALLOCATOR_GUARD() + buf := make([]u16, max(n, 260)+1, temp_allocator()) n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0) return _cleanpath_strip_prefix(buf[:n]), nil diff --git a/tests/core/sys/posix/posix.odin b/tests/core/sys/posix/posix.odin index bb5c7a65b..380149c42 100644 --- a/tests/core/sys/posix/posix.odin +++ b/tests/core/sys/posix/posix.odin @@ -196,11 +196,6 @@ test_monetary :: proc(t: ^testing.T) { @(test) test_stat :: proc(t: ^testing.T) { - testing.expect_value(t, posix.S_IRWXU, transmute(posix.mode_t)posix._mode_t(posix._S_IRWXU)) - testing.expect_value(t, posix.S_IRWXG, transmute(posix.mode_t)posix._mode_t(posix._S_IRWXG)) - testing.expect_value(t, posix.S_IRWXO, transmute(posix.mode_t)posix._mode_t(posix._S_IRWXO)) - testing.expect_value(t, posix._S_IFMT, transmute(posix.mode_t)posix._mode_t(posix.__S_IFMT)) - stat: posix.stat_t testing.expect_value(t, posix.stat(#file, &stat), posix.result.OK) testing.expect(t, posix.S_ISREG(stat.st_mode))