tree-wide: define and use STRERROR_OR_EOF()

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-10-11 16:58:21 +02:00
parent a6e016af01
commit f69ae8585f
5 changed files with 18 additions and 7 deletions
+6
View File
@@ -41,4 +41,10 @@ TEST(STRERROR) {
assert_se(strstr(c, buf));
}
TEST(STRERROR_OR_ELSE) {
log_info("STRERROR_OR_ELSE(0, \"EOF\") → %s", STRERROR_OR_EOF(0));
log_info("STRERROR_OR_ELSE(EPERM, \"EOF\") → %s", STRERROR_OR_EOF(EPERM));
log_info("STRERROR_OR_ELSE(-EPERM, \"EOF\") → %s", STRERROR_OR_EOF(-EPERM));
}
DEFINE_TEST_MAIN(LOG_INFO);