コード例 #1
0
static void
check_memleaks (void)
{
  dbus_shutdown ();

  if (_dbus_get_malloc_blocks_outstanding () != 0)
    {
      _dbus_warn ("%d dbus_malloc blocks were not freed in %s\n",
                  _dbus_get_malloc_blocks_outstanding (), __FILE__);
      _dbus_assert_not_reached ("memleaks");
    }
}
コード例 #2
0
static void
check_memleaks (void)
{
  dbus_shutdown ();

  printf ("%s: checking for memleaks\n", "dbus-test");
  if (_dbus_get_malloc_blocks_outstanding () != 0)
    {
      _dbus_warn ("%d dbus_malloc blocks were not freed\n",
                  _dbus_get_malloc_blocks_outstanding ());
      die ("memleaks");
    }
}
コード例 #3
0
ファイル: dbus-test-tap.c プロジェクト: halfline/dbus
/*
 * Shut down libdbus, check that exactly previously_allocated memory
 * blocks are allocated, and output TAP indicating a test pass or failure.
 *
 * Return TRUE if no leaks were detected.
 */
void
_dbus_test_check_memleaks (const char *test_name)
{
  dbus_shutdown ();

  if (_dbus_get_malloc_blocks_outstanding () == 0)
    {
      printf ("ok %u - %s did not leak memory\n", ++tap_test_counter,
          test_name);
    }
  else
    {
      printf ("not ok %u - %s leaked %d blocks\n",
          ++tap_test_counter, test_name,
          _dbus_get_malloc_blocks_outstanding ());
      failures++;
    }
}
コード例 #4
0
ファイル: test-main.c プロジェクト: cdaffara/symbiandump-os2
static void
check_memleaks (const char *name)
{
  dbus_shutdown ();
  
  printf ("%s: checking for memleaks\n", name);
  #ifdef __SYMBIAN32__
  std_log(LOG_FILENAME_LINE, "%s: checking for memleaks\n", name);
  #endif
  if (_dbus_get_malloc_blocks_outstanding () != 0)
    {
      _dbus_warn ("%d dbus_malloc blocks were not freed\n",
                  _dbus_get_malloc_blocks_outstanding ());
		#ifdef __SYMBIAN32__
		std_log(LOG_FILENAME_LINE, "%d dbus_malloc blocks were not freed\n",
                  _dbus_get_malloc_blocks_outstanding ());
		#endif
      die ("memleaks");
    }
}