From e8a262a1f2642bccd32738e8a47362ffa4f1055e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 29 Jan 2018 11:19:31 +0100 Subject: [PATCH] posix.cfg: Enable/Add fdopen tests (#1063) * posix.cfg: Enable/Add fdopen tests * posix.cfg: Add missing empty line --- test/cfg/posix.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 9d06dea3a..77df74a73 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -71,6 +71,10 @@ void nullPointer(char *p, int fd) // cppcheck-suppress unreadVariable // cppcheck-suppress nullPointer int ret = access(NULL, 0); + // cppcheck-suppress ignoredReturnValue + // cppcheck-suppress leakReturnValNotUsed + // cppcheck-suppress nullPointer + fdopen(fd, NULL); } void memleak_getaddrinfo() @@ -88,12 +92,11 @@ void memleak_mmap(int fd) // cppcheck-suppress memleak } -/* TODO: add configuration for fdopen void resourceLeak_fdopen(int fd) { + // cppcheck-suppress unreadVariable FILE *f = fdopen(fd, "r"); // cppcheck-suppress resourceLeak } -*/ void resourceLeak_fdopendir(int fd) { @@ -230,6 +233,11 @@ void uninitvar(int fd) // cppcheck-suppress unreadVariable // cppcheck-suppress uninitvar int access_ret = access("file", x); + + // cppcheck-suppress ignoredReturnValue + // cppcheck-suppress leakReturnValNotUsed + // cppcheck-suppress uninitvar + fdopen(x, "rw"); } void uninitvar_getcwd(void)