From dc2ea05fe17766a968a01fe112f50df07ab1066b Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Thu, 19 Dec 2024 17:37:27 +0100 Subject: [PATCH] Run test_fstatat on nodefs. NFC --- test/stat/test_fstatat.c | 16 ++++++++++++++-- test/test_core.py | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/test/stat/test_fstatat.c b/test/stat/test_fstatat.c index 9103f8db8ea51..2304b53460428 100644 --- a/test/stat/test_fstatat.c +++ b/test/stat/test_fstatat.c @@ -59,7 +59,7 @@ void test() { #ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); // WasmFS correctly counts 512B blocks, but MEMFS counts 4kb blocks. -#ifdef WASMFS +#if defined(WASMFS) || defined(NODEFS) || defined(NODERAWFS) assert(s.st_blocks == 8); #else assert(s.st_blocks == 1); @@ -79,7 +79,11 @@ void test() { assert(s.st_ctime); #ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); +#if defined(NODEFS) || defined(NODERAWFS) + assert(s.st_blocks == 8); +#else assert(s.st_blocks == 1); +#endif #endif close(fd); @@ -115,7 +119,7 @@ void test() { assert(s.st_ctime); #ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); -#ifdef WASMFS +#if defined(WASMFS) || defined(NODEFS) || defined(NODERAWFS) assert(s.st_blocks == 8); #else assert(s.st_blocks == 1); @@ -140,7 +144,11 @@ void test() { assert(s.st_ctime); #ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); +#if defined(NODEFS) || defined(NODERAWFS) + assert(s.st_blocks == 8); +#else assert(s.st_blocks == 1); +#endif #endif close(fd); @@ -159,7 +167,11 @@ void test() { assert(s.st_ctime); #ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); +#if defined(NODEFS) || defined(NODERAWFS) + assert(s.st_blocks == 0); +#else assert(s.st_blocks == 1); +#endif #endif puts("success"); diff --git a/test/test_core.py b/test/test_core.py index ba51f97e69200..65a0a46088c6b 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -5519,6 +5519,7 @@ def test_statx(self): self.set_setting("FORCE_FILESYSTEM") self.do_runf('stat/test_statx.c', 'success') + @also_with_nodefs_both def test_fstatat(self): self.do_runf('stat/test_fstatat.c', 'success')