tests: do not hardcode ENOENT

The actual values of errno constants are not specified in POSIX, and
left as implementation details; hence, tweak the check for the ENOENT
description to not check for the actual value.
main
Pino Toscano 2 years ago committed by Miloš Komarčević
parent b826a7d733
commit 7f997572f5

@ -39,7 +39,7 @@ TEST(strError, returnSuccessAfterClosingFile) {
TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile) { TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile) {
std::ifstream auxFile("nonExistingFile"); std::ifstream auxFile("nonExistingFile");
ASSERT_STREQ("No such file or directory (errno = 2)", strError().c_str()); ASSERT_TRUE(Internal::contains(strError(), "No such file or directory (errno = "));
} }
TEST(strError, doNotRecognizeUnknownError) { TEST(strError, doNotRecognizeUnknownError) {

Loading…
Cancel
Save