| 206 | } |
| 207 | |
| 208 | void SC::FileSystemTest::writeReadRemoveFile() |
| 209 | { |
| 210 | //! [writeReadRemoveFileSnippet] |
| 211 | FileSystem fs; |
| 212 | // Make all operations relative to applicationRootDirectory |
| 213 | SC_TEST_EXPECT(fs.init(report.applicationRootDirectory.view())); |
| 214 | StringView content = "ASDF content"; |
| 215 | |
| 216 | // Check that file doesn't exists before write-ing it and then check that it exist |
| 217 | SC_TEST_EXPECT(not fs.exists("file.txt")); |
| 218 | SC_TEST_EXPECT(fs.writeString("file.txt", content)); |
| 219 | SC_TEST_EXPECT(fs.existsAndIsFile("file.txt")); |
| 220 | |
| 221 | // Read the file and check its content |
| 222 | String newString = StringEncoding::Ascii; |
| 223 | SC_TEST_EXPECT(fs.read("file.txt", newString)); |
| 224 | SC_TEST_EXPECT(newString.view() == content); |
| 225 | |
| 226 | // Remove all files created by the test |
| 227 | SC_TEST_EXPECT(fs.removeFile("file.txt")); |
| 228 | SC_TEST_EXPECT(not fs.exists("file.txt")); |
| 229 | //! [writeReadRemoveFileSnippet] |
| 230 | } |
| 231 | |
| 232 | void SC::FileSystemTest::copyExistsFile() |
| 233 | { |
nothing calls this directly
no test coverage detected