| 25 | using namespace Exiv2; |
| 26 | |
| 27 | TEST(strError, returnSuccessAfterClosingFile) { |
| 28 | // previous system calls can fail, but errno is not guaranteed to be reset |
| 29 | // by a successful system call |
| 30 | // -> reset errno so that a real failure is only detected here |
| 31 | errno = 0; |
| 32 | |
| 33 | std::string tmpFile("tmp.dat"); |
| 34 | std::ofstream auxFile(tmpFile.c_str()); |
| 35 | auxFile.close(); |
| 36 | fs::remove(tmpFile.c_str()); |
| 37 | ASSERT_TRUE(Internal::contains(strError(), "(errno = 0)")); |
| 38 | } |
| 39 | |
| 40 | TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile) { |
| 41 | std::ifstream auxFile("nonExistingFile"); |
nothing calls this directly
no test coverage detected