Skip to content

Commit 190f1be

Browse files
authored
Disable incorrect part of test_getdents64_special_cases in wasmfs (#16958)
WasmFS correctly errors if an input filename is too long (with -ENAMETOOLONG). The old FS allows filenames larger than POSIX allows, and it truncates them silently in getdents(). WasmFS matches Linux and POSIX here.
1 parent e8a13ae commit 190f1be

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/fs/test_getdents64_special_cases.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ void doTest(const std::string& uniqueDirName, const std::string& fileName)
4343
}
4444

4545
printf("d.d_name = %s\n", d.d_name);
46+
47+
// If it needed to be, the name was truncated.
48+
assert(strlen(d.d_name) <= 255);
4649
}
4750
}
4851

@@ -51,6 +54,8 @@ int main()
5154
// Non-ascii file name.
5255
doTest("test_dir", u8"абвгд");
5356

57+
#ifndef WASMFS // The JS FS truncates filenames automatically, which is incorrect. Wasmfs and Linux do not.
5458
// File name exceeds the limit of 255 chars and is truncated.
5559
doTest("test_dir2", std::string(300, '1'));
60+
#endif
5661
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
test in test_dir: абвгд
22
d.d_name = абвгд
3-
test in test_dir2: 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
4-
d.d_name = 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

0 commit comments

Comments
 (0)