libmpm

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

commit 19df8b1d5d65661a0ca78c30a42fef370d7f31be
parent cdda67a9fd6af54a6144bd5754e415ad20e96368
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Fri, 16 Jun 2017 19:02:19 +0200

Add(Tests): Beginning of the tests on packer_file.c

Diffstat:
Mtests/main.c | 21+++++++++++----------
Mtests/test.h | 31++++++++++++++++---------------
Atests/test_packer_file.c | 9+++++++++
3 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/tests/main.c b/tests/main.c @@ -1,22 +1,23 @@ #include "test.h" -int main(void) { - int ret; +int main(void) { + int ret; mpm_init(); register_test_error(); - register_flags_test(); - register_test_database(); - register_test_files(); - register_test_category(); - register_test_config(); + register_flags_test(); + register_test_database(); + register_test_files(); + register_test_category(); + register_test_config(); register_test_packer(); + register_test_packer_file(); register_test_compile(); m_info("Beginning tests...\n"); - ret = test_all(); - test_free(); + ret = test_all(); + test_free(); - return ret; + return ret; } diff --git a/tests/test.h b/tests/test.h @@ -10,22 +10,23 @@ # define WAIT_AND_CLOSE(pid, status, fd) pid = waitpid(pid, &status, 0); close(fd[1]); -void register_flags_test(void); -void register_test_database(void); -void register_test_files(void); -void register_test_category(void); -void register_test_config(void); -void register_test_packer(void); -void register_test_compile(void); -void register_test_error(void); +void register_flags_test(void); +void register_test_database(void); +void register_test_files(void); +void register_test_category(void); +void register_test_config(void); +void register_test_packer(void); +void register_test_compile(void); +void register_test_error(void); +void register_test_packer_file(void); -void clean_db(const char *name); -int free_sql_results(void *ptr); -int free_single_result_sql(void *ptr); +void clean_db(const char *name); +int free_sql_results(void *ptr); +int free_single_result_sql(void *ptr); -typedef struct sql_result_s { - char *name; - char *value; -} sql_result_t; +typedef struct sql_result_s { + char *name; + char *value; +} sql_result_t; #endif /* TEST_H */ diff --git a/tests/test_packer_file.c b/tests/test_packer_file.c @@ -0,0 +1,9 @@ +#include "test.h" + +TEST(read_files_from_dir) { + return TEST_SUCCESS; +} + +void register_test_packer_file(void) { + reg_test("packer_file", read_files_from_dir); +}