Skip to content

Commit 1dea725

Browse files
committed
Failing in CI but not at desk (in C++), so add some logging sigh
1 parent 98c91cc commit 1dea725

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/Testing/Support/FileHandle.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,17 @@ let rootDirectoryPath: String = {
738738
if count > 0 {
739739
withUnsafeTemporaryAllocation(of: wchar_t.self, capacity: Int(count) + 1) { buffer in
740740
_ = GetSystemWindowsDirectoryW(buffer.baseAddress!, UINT(buffer.count))
741+
let windowsPath = String.decodeCString(buffer.baseAddress!, as: UTF16.self)?.result
741742
let rStrip = PathCchStripToRoot(buffer.baseAddress!, buffer.count)
742743
if rStrip == S_OK || rStrip == S_FALSE {
743744
result = String.decodeCString(buffer.baseAddress!, as: UTF16.self)?.result
745+
} else {
746+
fatalError("Failed to strip Windows path '\(windowsPath)': \(rStrip)")
744747
}
745748
}
749+
} else {
750+
let errorCode = GetLastError()
751+
fatalError("Failed to get the length of the system Windows directory path: \(errorCode)")
746752
}
747753

748754
// If we weren't able to get a path, fall back to "C:\" on the assumption that

0 commit comments

Comments
 (0)