Tidy up ringbuf and make tests

This commit is contained in:
Nils O. Selåsdal
2025-07-05 20:03:24 +02:00
parent 7373a93f9b
commit 1f6dee3a9a
4 changed files with 245 additions and 4 deletions
+6 -4
View File
@@ -34,6 +34,7 @@ extern Suite *ticket_lock_suite(void);
extern Suite *restart_counter_suite(void);
extern Suite *iomux_suite(void);
extern Suite *iomux_signal_suite(void);
extern Suite *ringbuf_suite(void);
static suite_func suites[] = {
bitvec_suite,
@@ -62,7 +63,8 @@ static suite_func suites[] = {
ticket_lock_suite,
restart_counter_suite,
iomux_suite,
iomux_signal_suite
iomux_signal_suite,
ringbuf_suite
};
@@ -105,7 +107,7 @@ main (int argc, char *argv[])
size_t i;
SRunner *sr = srunner_create (NULL);
if (xml_output)
if (xml_output)
srunner_set_xml(sr, "result.xml");
//set the environment variable CK_FORK=no which means don't fork().
@@ -131,10 +133,10 @@ main (int argc, char *argv[])
number_run = srunner_ntests_run(sr);
number_failed = srunner_ntests_failed (sr);
srunner_free (sr);
if (!number_run)
puts("ERROR: no tests were run");
if (number_failed)
if (number_failed)
printf("ERROR: %d tests failed\n", number_failed);
return (number_failed != 0) ;