posix/os2: fix test and add back in removed temp guard

This commit is contained in:
Laytan Laats
2024-08-02 22:09:04 +02:00
parent de9abe1f7b
commit f00f68ef6f
2 changed files with 2 additions and 5 deletions

View File

@@ -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

View File

@@ -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))