diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2016-07-01 11:47:15 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2016-07-01 11:47:15 +0200 |
commit | 6a0a1741f9e45a1e5233d3de6d612cbdac2e40ac (patch) | |
tree | 907c7f4fb2439f53ac6262ae02259094ff001be0 /fastos | |
parent | 00ee6e9b9c619b89d867aca47a55bbd57ca4af1a (diff) |
follow review feedback
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/tests/filetest.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/fastos/src/tests/filetest.cpp b/fastos/src/tests/filetest.cpp index a70e04c3acf..ca53c359605 100644 --- a/fastos/src/tests/filetest.cpp +++ b/fastos/src/tests/filetest.cpp @@ -384,16 +384,8 @@ public: try { const int attemptReadBytes = 173; ssize_t readB = file.Read(buffer, attemptReadBytes); - Progress(readB == attemptReadBytes, - "Read %d bytes successfully", - readB); - for (i = 0; i < attemptReadBytes; i++) { - rc = (buffer[i] == 'A' + ((i+ 1) % 17)); - if (!rc) { - Progress(false, "Read error at offset %d", i); - break; - } - } + Progress(false, "Expected to get an exception for unaligned read"); + ProgressI64(readB == attemptReadBytes, "Got %ld bytes from attempted 173", readB); } catch(const DirectIOException &e) { Progress(true, "Got exception as expected"); } @@ -404,19 +396,9 @@ public: if (rc) { try { const int attemptReadBytes = 4096; - ssize_t readB = file.Read(buffer, - attemptReadBytes); - Progress(readB == attemptReadBytes, - "Read %d bytes successfully", - readB); - for (i = 0; i < attemptReadBytes; i++) { - rc = (buffer[i] == 'A' + ((i+ 1) % 17)); - if (!rc) { - Progress(false, - "Read error at offset %d", i); - break; - } - } + ssize_t readB = file.Read(buffer, attemptReadBytes); + Progress(false, "Expected to get an exception for unaligned read"); + ProgressI64(readB == attemptReadBytes, "Got %ld bytes from attempted 4096", readB); } catch(const DirectIOException &e) { Progress(true, "Got exception as expected"); } @@ -464,7 +446,7 @@ public: bool writeResult = myFile->CheckedWrite(dummyData, 6); if (writeResult) { - Progress(false, "FAILED: Should not be able to write a file opened for read-only access."); + Progress(false, "Should not be able to write a file opened for read-only access."); } else { char dummyData2[28]; Progress(true, "Write failed with read-only access."); |