[libcxx-commits] [PATCH] D137131: [libc++] Android temp dir is /data/local/tmp, enable Windows test

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 7 10:36:08 PST 2022


rprichard added inline comments.


================
Comment at: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp:144
+        TEST_CHECK(win_dir_sz > 0 && win_dir_sz < MAX_PATH);
+        TEST_CHECK(win_dir[win_dir_sz-1] != L'\\');
+        TEST_CHECK(ret == win_dir);
----------------
mstorsjo wrote:
> I don't quite see why this specific line is needed here (I do kinda get what it hints at, based on the docs for `GetWindowsDirectoryW` though), but this should be effectively covered by the `ret == win_dir` check anyway, right? (I.e. the purpose of this test is to test the stdlib's temp path generation, not check `GetWindowsDirectoryW`.
I suppose I was trying to verify that ret and win_dir both do not end with a backslash. I can remove this line and rely on the MSDN docs if you'd like.

Aside, the MSDN docs contradict themselves in the (hypothetical) case that the Windows directory is the root:

https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getwindowsdirectoryw:
> This path does not end with a backslash unless the Windows directory is the root directory. For example, if the Windows directory is named Windows on drive C, the path of the Windows directory retrieved by this function is C:\Windows. If the system was installed in the root directory of drive C, the path retrieved is C:.

Realistically, I think that never happens?



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137131/new/

https://reviews.llvm.org/D137131



More information about the libcxx-commits mailing list