Skip to content

Commit

Permalink
tests: do not hardcode ENOENT
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pinotree authored and kmilos committed Jul 18, 2023
1 parent b826a7d commit 7f99757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unitTests/test_futils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TEST(strError, returnSuccessAfterClosingFile) {

TEST(strError, returnNoSuchFileOrDirectoryWhenTryingToOpenNonExistingFile) {
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) {
Expand Down

0 comments on commit 7f99757

Please sign in to comment.