diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2018-07-09 04:32:32 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-09 04:33:56 -0700 |
commit | c2b70f1e28b8fbc002efbac16d555f941c7d59a3 (patch) | |
tree | 79b2ab5eb0e1a7e4d971b94ba01e6415f7e6b5cd /src/test/cpp | |
parent | 4304542a7438acaeb09559e71a971e56fbecc4e5 (diff) |
Windows,JNI: more robust nativeCreateJunction
Rewrite the CreateJunction function in the Windows
JNI library.
The new implementation's improvements:
- succeeds if the junction already exists with the
desired target; hopefully this will fix issue
https://github.com/bazelbuild/bazel/issues/5433
- tolerant to concurrent filesystem modifications,
e.g. if the junction's path suddenly disappears,
the function reports the error correctly
Fixes https://github.com/bazelbuild/bazel/issues/5433
Change-Id: I58a2314a00f6edaa7c36c35ba54616168b44eb7d
Closes #5528.
Change-Id: I9f5dc9237b70a433d0d8c2578a826de3d462d110
PiperOrigin-RevId: 203744515
Diffstat (limited to 'src/test/cpp')
-rw-r--r-- | src/test/cpp/util/file_windows_test.cc | 4 | ||||
-rw-r--r-- | src/test/cpp/util/path_windows_test.cc | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/test/cpp/util/file_windows_test.cc b/src/test/cpp/util/file_windows_test.cc index c048e07950..6c1ec2f476 100644 --- a/src/test/cpp/util/file_windows_test.cc +++ b/src/test/cpp/util/file_windows_test.cc @@ -39,6 +39,7 @@ namespace blaze_util { using bazel::windows::CreateJunction; +using bazel::windows::CreateJunctionResult; using std::string; using std::unique_ptr; using std::wstring; @@ -66,7 +67,8 @@ class FileWindowsTest : public ::testing::Test { wstring wtarget; \ EXPECT_TRUE(AsWindowsPath(name, &wname, nullptr)); \ EXPECT_TRUE(AsWindowsPath(target, &wtarget, nullptr)); \ - EXPECT_EQ(L"", CreateJunction(wname, wtarget)); \ + EXPECT_EQ(CreateJunction(wname, wtarget, nullptr), \ + CreateJunctionResult::kSuccess); \ } // Asserts that dir1 can be created with some content, and dir2 doesn't exist. diff --git a/src/test/cpp/util/path_windows_test.cc b/src/test/cpp/util/path_windows_test.cc index 965d885c08..0638ebb06e 100644 --- a/src/test/cpp/util/path_windows_test.cc +++ b/src/test/cpp/util/path_windows_test.cc @@ -36,7 +36,6 @@ namespace blaze_util { -using bazel::windows::CreateJunction; using std::string; using std::unique_ptr; using std::wstring; |