lib

morphux C utility library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/lib

commit 4c01a1326aa542405919603c8034e77f5f42cafc
parent 88f048a944112f91323335c6602bfc1f68f4abb2
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Fri,  3 Mar 2017 14:45:01 +0100

Fix(Tests): m_print tests, forgetten close() after open()

Diffstat:
Mtests/test_print.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/tests/test_print.c b/tests/test_print.c @@ -79,6 +79,7 @@ TEST(print_log_1) { TEST_ASSERT(fd != 0, "Can't open the log file"); TEST_ASSERT(read(fd, buf, 8) == 8, "Read return is wrong"); + close(fd); TEST_ASSERT(memcmp(buf, "Test 123", 8) == 0, "Content of the file is wrong"); return TEST_SUCCESS; } @@ -119,6 +120,7 @@ TEST(print_log_minfo) { TEST_ASSERT(fd != 0, "Can't open the log file"); TEST_ASSERT(read(fd, buf, 8) == 8, "Read return is wrong"); + close(fd); TEST_ASSERT(memcmp(buf, "Test 123", 8) == 0, "Content of the file is wrong"); TEST_ASSERT(m_clean_log() == true, "Return is wrong"); return TEST_SUCCESS; @@ -134,6 +136,7 @@ TEST(print_log_mwarning) { TEST_ASSERT(fd != 0, "Can't open the log file"); TEST_ASSERT(read(fd, buf, 8) == 8, "Read return is wrong"); TEST_ASSERT(memcmp(buf, "Test 123", 8) == 0, "Content of the file is wrong"); + close(fd); TEST_ASSERT(m_clean_log() == true, "Return is wrong"); return TEST_SUCCESS; } @@ -148,6 +151,7 @@ TEST(print_log_merror) { TEST_ASSERT(fd != 0, "Can't open the log file"); TEST_ASSERT(read(fd, buf, 8) == 8, "Read return is wrong"); TEST_ASSERT(memcmp(buf, "Test 123", 8) == 0, "Content of the file is wrong"); + close(fd); TEST_ASSERT(m_clean_log() == true, "Return is wrong"); return TEST_SUCCESS; } @@ -172,6 +176,7 @@ TEST(print_log_mpanic) { TEST_ASSERT(fd != 0, "Can't open the log file"); TEST_ASSERT(read(fd, buf, 8) == 8, "Read return is wrong"); + close(fd); TEST_ASSERT(memcmp(buf, "Test 123", 8) == 0, "Content of the file is wrong"); TEST_ASSERT(m_clean_log() == true, "Return is wrong"); return TEST_SUCCESS;