28#include "dbus/dbus-test-tap.h"
41static unsigned int failures = 0;
42static unsigned int skipped = 0;
43static unsigned int tap_test_counter = 0;
49_dbus_test_fatal (
const char *format,
54 printf (
"Bail out! ");
55 va_start (ap, format);
67_dbus_test_diag (
const char *format,
73 va_start (ap, format);
88_dbus_test_skip_all (
const char *format,
95 printf (
"1..0 # SKIP - ");
96 va_start (ap, format);
109_dbus_test_ok (
const char *format,
114 printf (
"ok %u - ", ++tap_test_counter);
115 va_start (ap, format);
116 vprintf (format, ap);
127_dbus_test_not_ok (
const char *format,
132 printf (
"not ok %u - ", ++tap_test_counter);
133 va_start (ap, format);
134 vprintf (format, ap);
146_dbus_test_skip (
const char *format,
151 printf (
"ok %u # SKIP ", ++tap_test_counter);
153 va_start (ap, format);
154 vprintf (format, ap);
167_dbus_test_check_memleaks (
const char *test_name)
169#ifdef DBUS_ENABLE_EMBEDDED_TESTS
172 if (_dbus_get_malloc_blocks_outstanding () == 0)
174 printf (
"ok %u - %s did not leak memory\n", ++tap_test_counter,
179 printf (
"not ok %u - %s leaked %d blocks\n",
180 ++tap_test_counter, test_name,
181 _dbus_get_malloc_blocks_outstanding ());
186 "unable to determine whether %s leaked memory (not compiled "
187 "with memory instrumentation)",
197_dbus_test_done_testing (
void)
202 _dbus_test_diag (
"%u tests passed (%d skipped)",
203 tap_test_counter - skipped, skipped);
205 _dbus_test_diag (
"%u/%u tests failed (%d skipped)",
206 failures, tap_test_counter - skipped, skipped);
208 printf (
"1..%u\n", tap_test_counter);
#define _dbus_assert(condition)
Aborts with an error message if the condition is false.
void dbus_shutdown(void)
Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().