From 7f997572f55c11998a379b5a0d39eef6181caa82 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 18 Jul 2023 06:31:30 +0200 Subject: [PATCH] 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. --- unitTests/test_futils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unitTests/test_futils.cpp b/unitTests/test_futils.cpp index 09bf0339..b135b1a1 100644 --- a/unitTests/test_futils.cpp +++ b/unitTests/test_futils.cpp @@ -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) {