From 0696a5c7f9abe5451a0baf3170296704714fcce8 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 23 Nov 2019 20:31:58 +0100 Subject: Basic segfault and comparison test for ft_strlen.s --- helper.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 helper.c (limited to 'helper.c') diff --git a/helper.c b/helper.c new file mode 100644 index 0000000..b2b2a18 --- /dev/null +++ b/helper.c @@ -0,0 +1,29 @@ +#include "libasm_test.h" + + +void +print_ok(void) +{ + printf("OK: %s\n", test_name); +} + +void +print_stack_alignment_error(void) +{ + printf("KO: [STACK ALIGNMENT]: %s\n", test_name); +} + +void +print_signaled_ko(void) +{ + printf("KO: [SEGFAULT]: %s\n", test_name); +} + +void +expect_int(int expected, int actual) +{ + if (actual != expected) + printf("KO: [COMPARE]: %s: expected: %d got: %d\n", test_name, expected, actual); + else + print_ok(); +} -- cgit