From 6fcbbaafc4bae79d4e674a2cf7f1d87d5a471603 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:28:35 +0100 Subject: Implement first unit test for check_swap --- plugins/tests/test_check_swap.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/tests/test_check_swap.c (limited to 'plugins/tests/test_check_swap.c') diff --git a/plugins/tests/test_check_swap.c b/plugins/tests/test_check_swap.c new file mode 100644 index 00000000..42ac0086 --- /dev/null +++ b/plugins/tests/test_check_swap.c @@ -0,0 +1,21 @@ + +#include "../check_swap.d/check_swap.h" +#include "../../tap/tap.h" + +void print_usage() {}; +void print_help(swap_config config) { + (void) config; +}; + +const char *progname = "test_check_swap"; + +int main() { + + swap_config config = swap_config_init(); + + swap_result test_data = get_swap_data(config); + + plan_tests(1); + + ok(test_data.errorcode == 0, "Test whether we manage to retrieve swap data"); +} -- cgit v1.2.3-74-g34f1