libmpm

morphux C package management library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/libmpm

commit f65e2c2a20283225af8168639d8763d5ea12eb02
parent e77d7e94846ec0288c653cec2a4a294d94e22376
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Wed,  8 Feb 2017 10:15:54 +0100

Fix(Test): Variable out of scope in fork():

And a bad allocation

Diffstat:
Mtests/test_database.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/test_database.c b/tests/test_database.c @@ -481,12 +481,13 @@ TEST(database_sql_to_categ) { ptr = sql_to_category(NULL, NULL, NULL); TEST_ASSERT((ptr == NULL), "Pointer is not NULL"); - ptr = malloc(sizeof(file_t)); + ptr = malloc(sizeof(category_t)); pipe(fd); if ((pid = fork()) == 0) { DUP_ALL_OUTPUTS(fd); - ptr = sql_to_category(ptr, "Unknown", "Nothing"); + sql_to_category(ptr, "Unknown", "Nothing"); + exit(0); } else { WAIT_AND_CLOSE(pid, st, fd); TEST_ASSERT((WEXITSTATUS(st) == 1), "Exit code is wrong");