             let error = strerror(errno)!
             XCTFail("Failed to set up test paths: \(String(cString: error))")
         }
+        defer { FileManager.default.changeCurrentDirectoryPath(TestURL.gSavedPath) }
         
         // test with file that exists
         var path = TestURL.gFileExistsPath

    static var gBaseCurrentWorkingDirectoryPath : String {
        return FileManager.default.currentDirectoryPath
    }
    static var gRelativeOffsetFromBaseCurrentWorkingDirectory: UInt = 0
    static let gFileExistsName = "TestCFURL_file_exists\(ProcessInfo.processInfo.globallyUniqueString)"
    static let gFileDoesNotExistName = "TestCFURL_file_does_not_exist"

            let error = strerror(errno)!
            XCTFail("Failed to set up test paths: \(String(cString: error))")
        }
        defer { FileManager.default.changeCurrentDirectoryPath(TestURL.gSavedPath) }
        
        // test with file that exists
        var path = TestURL.gFileExistsPath
