"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dbus/dbus-test-tap.c" between
dbus-1.13.12.tar.xz and dbus-1.13.14.tar.xz

About: D-Bus is an inter-process communication (IPC) system, allowing multiple, concurrently-running applications to communicate with one another. D-Bus supplies both a system daemon and a per-user-login-session daemon. Development version.

dbus-test-tap.c  (dbus-1.13.12.tar.xz):dbus-test-tap.c  (dbus-1.13.14.tar.xz)
skipping to change at line 38 skipping to change at line 38
#include "dbus/dbus-test-tap.h" #include "dbus/dbus-test-tap.h"
/* /*
* TAP, the Test Anything Protocol, is a text-based syntax for test-cases * TAP, the Test Anything Protocol, is a text-based syntax for test-cases
* to report results to test harnesses. * to report results to test harnesses.
* *
* See <http://testanything.org/> for details of the syntax, which * See <http://testanything.org/> for details of the syntax, which
* will not be explained here. * will not be explained here.
*/ */
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
static unsigned int failures = 0; static unsigned int failures = 0;
static unsigned int tap_test_counter = 0; static unsigned int tap_test_counter = 0;
/* /*
* Output TAP indicating a fatal error, and exit unsuccessfully. * Output TAP indicating a fatal error, and exit unsuccessfully.
*/ */
void void
skipping to change at line 169 skipping to change at line 167
/* /*
* Shut down libdbus, check that exactly previously_allocated memory * Shut down libdbus, check that exactly previously_allocated memory
* blocks are allocated, and output TAP indicating a test pass or failure. * blocks are allocated, and output TAP indicating a test pass or failure.
* *
* Return TRUE if no leaks were detected. * Return TRUE if no leaks were detected.
*/ */
void void
_dbus_test_check_memleaks (const char *test_name) _dbus_test_check_memleaks (const char *test_name)
{ {
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
dbus_shutdown (); dbus_shutdown ();
if (_dbus_get_malloc_blocks_outstanding () == 0) if (_dbus_get_malloc_blocks_outstanding () == 0)
{ {
printf ("ok %u - %s did not leak memory\n", ++tap_test_counter, printf ("ok %u - %s did not leak memory\n", ++tap_test_counter,
test_name); test_name);
} }
else else
{ {
printf ("not ok %u - %s leaked %d blocks\n", printf ("not ok %u - %s leaked %d blocks\n",
++tap_test_counter, test_name, ++tap_test_counter, test_name,
_dbus_get_malloc_blocks_outstanding ()); _dbus_get_malloc_blocks_outstanding ());
failures++; failures++;
} }
#else
_dbus_test_skip (
"unable to determine whether %s leaked memory (not compiled "
"with memory instrumentation)",
test_name);
#endif
} }
/* /*
* Output TAP indicating that testing has finished and no more tests * Output TAP indicating that testing has finished and no more tests
* are going to be run. Return the Unix-style exit code. * are going to be run. Return the Unix-style exit code.
*/ */
int int
_dbus_test_done_testing (void) _dbus_test_done_testing (void)
{ {
if (failures == 0) if (failures == 0)
skipping to change at line 205 skipping to change at line 210
_dbus_test_diag ("%u/%u tests failed", failures, tap_test_counter); _dbus_test_diag ("%u/%u tests failed", failures, tap_test_counter);
printf ("1..%u\n", tap_test_counter); printf ("1..%u\n", tap_test_counter);
fflush (stdout); fflush (stdout);
if (failures == 0) if (failures == 0)
return 0; return 0;
return 1; return 1;
} }
#endif
 End of changes. 4 change blocks. 
2 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)