upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/file_system_test.cpp
diff options
context:
space:
mode:
authorMaxime Mansiet <AirKyzzZ@users.noreply.github.com>2026-11-23 02:22:26 +0100
committerMaxime Mansiet <AirKyzzZ@users.noreply.github.com>2026-11-23 02:22:26 +0100
commit844e650bfabc57342ece360830a4cc72fc59b6c8 (patch)
treec0f31a97f8b3a2f3f2fc8dea543a65d6acf08a57 /runtime/test/file_system_test.cpp
parent2036d725c5f2d3b6f54e3a86448ced6e921f7e47 (diff)
file_system: only a T: path names the T:\ root, so GAME:\.gta6rt-temp is not refused as one
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
Diffstat (limited to 'runtime/test/file_system_test.cpp')
-rw-r--r--runtime/test/file_system_test.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/test/file_system_test.cpp b/runtime/test/file_system_test.cpp
index 1819ecb27..939517e23 100644
--- a/runtime/test/file_system_test.cpp
+++ b/runtime/test/file_system_test.cpp
@@ -672,8 +672,9 @@ int main() {
672 check(t_root != INVALID_FILE_ATTRIBUTES && (t_root & FILE_ATTRIBUTE_DIRECTORY) != 0 && GetLastError() == 0, 672 check(t_root != INVALID_FILE_ATTRIBUTES && (t_root & FILE_ATTRIBUTE_DIRECTORY) != 0 && GetLastError() == 0,
673 "on a fresh overlay GetFileAttributesW(T:\\) is a folder, and making it leaves the last error alone"); 673 "on a fresh overlay GetFileAttributesW(T:\\) is a folder, and making it leaves the last error alone");
674 fresh_overlay(); 674 fresh_overlay();
675 check(!list(first_w, next_w, find_close, L"T:\\*").empty(), 675 const std::vector<std::wstring> t_names = list(first_w, next_w, find_close, L"T:\\*");
676 "on a fresh overlay FindFirstFileW(T:\\*) lists the root"); 676 check(t_names.size() == 2 && count(t_names, L".") == 1 && count(t_names, L"..") == 1,
677 "on a fresh overlay FindFirstFileW(T:\\*) lists the empty root as . and ..");
677 fresh_overlay(); 678 fresh_overlay();
678 check(mkdir_w(L"T:\\shadercache", nullptr) != FALSE, 679 check(mkdir_w(L"T:\\shadercache", nullptr) != FALSE,
679 "on a fresh overlay CreateDirectoryW(T:\\shadercache) succeeds"); 680 "on a fresh overlay CreateDirectoryW(T:\\shadercache) succeeds");
@@ -692,6 +693,12 @@ int main() {
692 attributes_w(L"GAME:\\moved") == INVALID_FILE_ATTRIBUTES && 693 attributes_w(L"GAME:\\moved") == INVALID_FILE_ATTRIBUTES &&
693 std::filesystem::is_directory(fresh / ".gta6rt-temp"), 694 std::filesystem::is_directory(fresh / ".gta6rt-temp"),
694 "T:\\ cannot be moved"); 695 "T:\\ cannot be moved");
696 fresh_overlay();
697 attributes_w(L"T:\\");
698 SetLastError(0);
699 const BOOL removed_by_game_path = rmdir_w(L"GAME:\\.gta6rt-temp");
700 check(removed_by_game_path != FALSE || GetLastError() != ERROR_ACCESS_DENIED,
701 "only a T: path names the T:\\ root: GAME:\\.gta6rt-temp is not refused as a drive root");
695 rt::fs::configure(package, overlay); 702 rt::fs::configure(package, overlay);
696 703
697 h = create_w(L"T:\\cache\\scratch.bin", GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr); 704 h = create_w(L"T:\\cache\\scratch.bin", GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr);