[Lldb-commits] [PATCH] D18044: Fix a couple of cornercases in FileSpec + tests

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 16 06:19:31 PDT 2016


labath added inline comments.

================
Comment at: lldb/trunk/unittests/Host/FileSpecTest.cpp:25
@@ +24,3 @@
+    EXPECT_STREQ("F:\\bar", fs_windows.GetCString());
+    EXPECT_STREQ("F:", fs_windows.GetDirectory().GetCString());
+    EXPECT_STREQ("bar", fs_windows.GetFilename().GetCString());
----------------
So this returns `F:` on linux and `F:\` on Windows. This happens because `llvm::sys::path::parent_path` does not recognize `F:` as a "root directory" on linux, and therefore treats it differently. I don't know which behavior is more "correct" (probably the windows one), but I think that this should be consistent, regardless of the platform the test is run on (my original motivation for writing this was the fact that i was getting wonky paths while attempting to write other unit tests). Unfortunately, I think that means getting rid of llvm's path processing library...

What do you make of that?

(I am going on holiday, so I cannot to anything about this now. if you want to have a clean test run in the mean time, I am fine commenting these checks out or something...)


Repository:
  rL LLVM

http://reviews.llvm.org/D18044





More information about the lldb-commits mailing list