From c2fa8279933a103d6576d891e85c1801d90c65ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 16 Jun 2006 13:48:52 +0200 Subject: Add unit testing infrastructure. --- tests/check.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/check.c (limited to 'tests/check.c') diff --git a/tests/check.c b/tests/check.c new file mode 100644 index 00000000..999da16a --- /dev/null +++ b/tests/check.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include + +/* From check_util.c */ +Suite *util_suite(void); + +int main (void) +{ + int nf; + SRunner *sr = srunner_create(util_suite()); + srunner_run_all (sr, CK_NORMAL); + nf = srunner_ntests_failed(sr); + srunner_free(sr); + return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} -- cgit v1.2.3 From 1fc2958b1e503b782081692c1a503bc7bba19fe1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 16 Jun 2006 14:07:51 +0200 Subject: Add checks for nick functions as well, fix bug where nick lengths weren't being honored. --- tests/check.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/check.c') diff --git a/tests/check.c b/tests/check.c index 999da16a..5cfb7dfd 100644 --- a/tests/check.c +++ b/tests/check.c @@ -2,14 +2,29 @@ #include #include #include +#include "bitlbee.h" + +global_t global; /* Against global namespace pollution */ + +double gettime() +{ + struct timeval time[1]; + + gettimeofday( time, 0 ); + return( (double) time->tv_sec + (double) time->tv_usec / 1000000 ); +} /* From check_util.c */ Suite *util_suite(void); +/* From check_nick.c */ +Suite *nick_suite(void); + int main (void) { int nf; SRunner *sr = srunner_create(util_suite()); + srunner_add_suite(sr, nick_suite()); srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); -- cgit v1.2.3