MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / TEST

Function TEST

unitTests/test_futils.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using namespace Exiv2;
26
27TEST(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
40TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile) {
41 std::ifstream auxFile("nonExistingFile");

Callers

nothing calls this directly

Calls 13

containsFunction · 0.85
strErrorFunction · 0.85
getEnvFunction · 0.85
urlencodeFunction · 0.85
urldecodeFunction · 0.85
base64encodeFunction · 0.85
base64decodeFunction · 0.85
getProcessPathFunction · 0.85
c_strMethod · 0.80
closeMethod · 0.80
dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected