summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWander Lairson Costa <wander.lairson@gmail.com>2020-06-12 20:27:51 +0000
committerStefan Schmidt <s.schmidt@samsung.com>2020-06-23 14:03:28 +0200
commitbe5b6b24768d95eceb5749711e5034b7d65dd547 (patch)
tree82d13eb691a3a815d6ed7e5cd1ec4219a525e63a
parente137478dc5b01f77c281cc2efbc0f96f32824307 (diff)
downloadefl-be5b6b24768d95eceb5749711e5034b7d65dd547.tar.gz
eina_test_file.c: Do not test errno if the function doesn't fail
errno only holds a valid value if the function returns an error. ref: windows-native-port Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11971
-rw-r--r--src/tests/eina/eina_test_file.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/tests/eina/eina_test_file.c b/src/tests/eina/eina_test_file.c
index ccd6e55ca5..0ed1c93d75 100644
--- a/src/tests/eina/eina_test_file.c
+++ b/src/tests/eina/eina_test_file.c
@@ -746,15 +746,13 @@ EFL_START_TEST(eina_test_file_mktemp)
"./eina_file_test_XXXXXX.txt",
};
- errno = 0;
-
/* test NULL */
EXPECT_ERROR_START;
fd = eina_file_mkstemp(NULL, NULL);
fail_if(fd >= 0);
EXPECT_ERROR_END;
fd = eina_file_mkstemp(patterns[0], NULL);
- fail_if((fd < 0) || errno);
+ fail_if(fd < 0);
/* here's an attempt at removing the file, without knowing its path */
#ifdef F_GETPATH
@@ -783,12 +781,10 @@ EFL_START_TEST(eina_test_file_mktemp)
for (unsigned int k = 0; k < sizeof(patterns) / sizeof(patterns[0]); k++)
{
- errno = 0;
tmpfile = NULL;
fd = eina_file_mkstemp(patterns[k], &tmpfile);
ck_assert(fd >= 0);
ck_assert(!!tmpfile);
- ck_assert_msg(!errno, "ERROR(%s): %s\n", patterns[k], strerror(errno));
file = eina_file_open(tmpfile, EINA_FALSE);
fail_if(!file);
eina_file_close(file);
@@ -813,7 +809,7 @@ EFL_START_TEST(eina_test_file_mktemp)
eina_file_path_join(buf, sizeof(buf), tmpdir, "eina_file_test_XXXXXX.txt");
fd = eina_file_mkstemp(buf, &tmpfile);
- fail_if((fd < 0) || !tmpfile || errno);
+ fail_if((fd < 0) || !tmpfile);
fail_if(close(fd));
it = eina_file_direct_ls(tmpdir);