Browse Source

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

Laytan Laats 1 year ago
parent
commit
f00f68ef6f
2 changed files with 2 additions and 5 deletions
  1. 2 0
      core/os/os2/stat_windows.odin
  2. 0 5
      tests/core/sys/posix/posix.odin

+ 2 - 0
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

+ 0 - 5
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))