Commit d6010a88 authored by Drew's avatar Drew

Various file-related issues

This PR exposes various issues in the filesubsystem, to wit:

1.  File tests were not enabled.  I enabled them; now some of them fail
2.  I added a new test that loads a non-existent file
3.  The above-styled test segfaults in libc on Linux x64

    ```
    * thread #1: tid = 14, 0x00007ffff64b75e4 libc.so.6`fclose + 4, name = 'atbuild', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x00007ffff64b75e4 libc.so.6`fclose + 4
    ```
4.  This segfault is the root cause of the CI failure in
    https://github.com/AnarchyTools/atbuild/pull/88
parent 5556b96b
Pipeline #1718 failed with stage
......@@ -197,6 +197,11 @@ class FSTests: XCTestCase {
}
}
func testLoadNonexistentFile() {
let p = Path("doesnotexist.file")
let _ = try? File(path: p, mode: .ReadOnly)
}
}
extension FSTests {
......@@ -214,7 +219,8 @@ extension FSTests {
("testChmodFile", testChmodFile),
("testResolveGroup", testResolveGroup),
("testResolveUser", testResolveUser),
("testSetGroup", testSetGroup)
("testSetGroup", testSetGroup),
("testLoadNonexistentFile", testLoadNonexistentFile)
]
}
}
\ No newline at end of file
......@@ -25,4 +25,5 @@ XCTMain([
testCase(PathTests.allTests),
testCase(DateTests.allTests),
testCase(LoggerTests.allTests),
testCase(FSTests.allTests)
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment