Commit ed40af92 authored by Simon McVittie's avatar Simon McVittie

Embedded tests: Emit TAP diagnostics instead of printf

Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103601
parent 5ffb709b
......@@ -28,6 +28,7 @@
#include "utils.h"
#include <dbus/dbus-list.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-test-tap.h>
#include <string.h>
/**
......@@ -400,7 +401,7 @@ check_return_values (const DBusString *full_path)
dbus_error_init (&error);
retval = FALSE;
printf ("Testing values from: %s\n", _dbus_string_get_const_data (full_path));
_dbus_test_diag ("Testing values from: %s", _dbus_string_get_const_data (full_path));
parser = bus_config_load (full_path, TRUE, NULL, &error);
if (parser == NULL)
......@@ -426,7 +427,7 @@ check_return_values (const DBusString *full_path)
_dbus_warn ("User was invalid; '%s'!", user);
goto finish;
}
printf (" <user>dbus</user> OKAY!\n");
_dbus_test_diag (" <user>dbus</user> OKAY!");
#endif
/* check type return value is okay */
......@@ -441,7 +442,7 @@ check_return_values (const DBusString *full_path)
_dbus_warn ("Type was invalid; '%s'!", user);
goto finish;
}
printf (" <type>system</type> OKAY!\n");
_dbus_test_diag (" <type>system</type> OKAY!");
/* check dirs return value is okay */
dirs = bus_config_parser_get_service_paths (parser);
......@@ -450,7 +451,7 @@ check_return_values (const DBusString *full_path)
_dbus_warn ("Service dirs are NULL!");
goto finish;
}
printf (" <standard_system_service_dirs/> OKAY!\n");
_dbus_test_diag (" <standard_system_service_dirs/> OKAY!");
/* NOTE: We tested the specific return values in the config-parser tests */
/* woohoo! */
......@@ -570,11 +571,11 @@ process_test_valid_subdir (const DBusString *test_base_dir,
}
if (validity == VALID)
printf ("Testing valid files:\n");
_dbus_test_diag ("Testing valid files:");
else if (validity == INVALID)
printf ("Testing invalid files:\n");
_dbus_test_diag ("Testing invalid files:");
else
printf ("Testing unknown files:\n");
_dbus_test_diag ("Testing unknown files:");
next:
while (_dbus_directory_get_next_file (dir, &filename, &error))
......@@ -599,7 +600,7 @@ process_test_valid_subdir (const DBusString *test_base_dir,
goto next;
}
printf (" %s\n", _dbus_string_get_const_data (&filename));
_dbus_test_diag (" %s", _dbus_string_get_const_data (&filename));
_dbus_verbose (" expecting %s\n",
validity == VALID ? "valid" :
......@@ -695,14 +696,14 @@ check_file_valid (DBusString *full_path,
dbus_bool_t retval;
if (validity == VALID)
printf ("Testing valid file:\n");
_dbus_test_diag ("Testing valid file:");
else if (validity == INVALID)
printf ("Testing invalid file:\n");
_dbus_test_diag ("Testing invalid file:");
else
printf ("Testing unknown file:\n");
_dbus_test_diag ("Testing unknown file:");
/* print the filename, just so we match the other output */
printf (" %s\n", _dbus_string_get_const_data (full_path));
_dbus_test_diag (" %s", _dbus_string_get_const_data (full_path));
/* only test one file */
retval = do_load (full_path, validity, TRUE);
......@@ -721,7 +722,7 @@ bus_config_parser_trivial_test (const DBusString *test_data_dir)
if (test_data_dir == NULL ||
_dbus_string_get_length (test_data_dir) == 0)
{
printf ("No test data\n");
_dbus_test_diag ("No test data");
return TRUE;
}
......
......@@ -33,6 +33,7 @@
#include <dbus/dbus-internals.h>
#include <dbus/dbus-misc.h>
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-test-tap.h>
#include <string.h>
typedef enum
......@@ -3081,7 +3082,7 @@ do_check_own_rules (BusPolicy *policy)
_dbus_assert_not_reached ("couldn't append string");
ret = bus_policy_check_can_own (policy, &service_name);
printf (" Check name %s: %s\n", checks[i].name,
_dbus_test_diag (" Check name %s: %s", checks[i].name,
ret ? "allowed" : "not allowed");
if (checks[i].allowed && !ret)
{
......@@ -3216,11 +3217,11 @@ process_test_valid_subdir (const DBusString *test_base_dir,
}
if (validity == VALID)
printf ("Testing valid files:\n");
_dbus_test_diag ("Testing valid files:");
else if (validity == INVALID)
printf ("Testing invalid files:\n");
_dbus_test_diag ("Testing invalid files:");
else
printf ("Testing unknown files:\n");
_dbus_test_diag ("Testing unknown files:");
next:
while (_dbus_directory_get_next_file (dir, &filename, &error))
......@@ -3245,7 +3246,7 @@ process_test_valid_subdir (const DBusString *test_base_dir,
goto next;
}
printf (" %s\n", _dbus_string_get_const_data (&filename));
_dbus_test_diag (" %s", _dbus_string_get_const_data (&filename));
_dbus_verbose (" expecting %s\n",
validity == VALID ? "valid" :
......@@ -3537,7 +3538,7 @@ all_are_equiv (const DBusString *target_directory)
goto finished;
}
printf ("Comparing equivalent files:\n");
_dbus_test_diag ("Comparing equivalent files:");
next:
while (_dbus_directory_get_next_file (dir, &filename, &error))
......@@ -3561,7 +3562,7 @@ all_are_equiv (const DBusString *target_directory)
goto next;
}
printf (" %s\n", _dbus_string_get_const_data (&filename));
_dbus_test_diag (" %s", _dbus_string_get_const_data (&filename));
parser = bus_config_load (&full_path, TRUE, NULL, &error);
......@@ -3778,9 +3779,9 @@ test_default_session_servicedirs (const DBusString *test_base_dir)
if (dbus_test_builddir == NULL || xdg_data_home == NULL ||
xdg_runtime_dir == NULL)
{
printf ("Not testing default session service directories because a "
_dbus_test_diag ("Not testing default session service directories because a "
"build-time testing environment variable is not set: "
"see AM_TESTS_ENVIRONMENT in tests/Makefile.am\n");
"see AM_TESTS_ENVIRONMENT in tests/Makefile.am");
ret = TRUE;
goto out;
}
......@@ -3832,17 +3833,17 @@ test_default_session_servicedirs (const DBusString *test_base_dir)
BusConfigServiceDir *dir = link->data;
BusServiceDirFlags expected = BUS_SERVICE_DIR_FLAGS_NONE;
printf (" test service dir: '%s'\n", dir->path);
printf (" current standard service dir: '%s'\n", test_session_service_dir_matches[i]);
_dbus_test_diag (" test service dir: '%s'", dir->path);
_dbus_test_diag (" current standard service dir: '%s'", test_session_service_dir_matches[i]);
if (test_session_service_dir_matches[i] == NULL)
{
printf ("more directories parsed than in match set\n");
_dbus_test_diag ("more directories parsed than in match set");
goto out;
}
if (strcmp (test_session_service_dir_matches[i], dir->path) != 0)
{
printf ("'%s' directory does not match '%s' in the match set\n",
_dbus_test_diag ("'%s' directory does not match '%s' in the match set",
dir->path, test_session_service_dir_matches[i]);
goto out;
}
......@@ -3857,7 +3858,7 @@ test_default_session_servicedirs (const DBusString *test_base_dir)
if (dir->flags != expected)
{
printf ("'%s' directory has flags 0x%x, should be 0x%x\n",
_dbus_test_diag ("'%s' directory has flags 0x%x, should be 0x%x",
dir->path, dir->flags, expected);
goto out;
}
......@@ -3865,7 +3866,7 @@ test_default_session_servicedirs (const DBusString *test_base_dir)
if (test_session_service_dir_matches[i] != NULL)
{
printf ("extra data %s in the match set was not matched\n",
_dbus_test_diag ("extra data %s in the match set was not matched",
test_session_service_dir_matches[i]);
goto out;
}
......@@ -3887,20 +3888,20 @@ test_default_session_servicedirs (const DBusString *test_base_dir)
link != NULL;
link = _dbus_list_get_next_link (&watched_dirs, link), i++)
{
printf (" watched service dir: '%s'\n", (const char *) link->data);
printf (" current standard service dir: '%s'\n",
_dbus_test_diag (" watched service dir: '%s'", (const char *) link->data);
_dbus_test_diag (" current standard service dir: '%s'",
test_session_service_dir_matches[i]);
if (test_session_service_dir_matches[i] == NULL)
{
printf ("more directories parsed than in match set\n");
_dbus_test_diag ("more directories parsed than in match set");
goto out;
}
if (strcmp (test_session_service_dir_matches[i],
(const char *) link->data) != 0)
{
printf ("'%s' directory does not match '%s' in the match set\n",
_dbus_test_diag ("'%s' directory does not match '%s' in the match set",
(const char *) link->data,
test_session_service_dir_matches[i]);
goto out;
......@@ -3909,7 +3910,7 @@ test_default_session_servicedirs (const DBusString *test_base_dir)
if (test_session_service_dir_matches[i] != NULL)
{
printf ("extra data %s in the match set was not matched\n",
_dbus_test_diag ("extra data %s in the match set was not matched",
test_session_service_dir_matches[i]);
goto out;
}
......@@ -3957,10 +3958,10 @@ test_default_system_servicedirs (void)
i = 0;
while ((link = _dbus_list_pop_first_link (&dirs)))
{
printf (" test service dir: %s\n", (char *)link->data);
_dbus_test_diag (" test service dir: %s", (char *)link->data);
if (test_system_service_dir_matches[i] == NULL)
{
printf ("more directories parsed than in match set\n");
_dbus_test_diag ("more directories parsed than in match set");
dbus_free (link->data);
_dbus_list_free_link (link);
return FALSE;
......@@ -3969,7 +3970,7 @@ test_default_system_servicedirs (void)
if (strcmp (test_system_service_dir_matches[i],
(char *)link->data) != 0)
{
printf ("%s directory does not match %s in the match set\n",
_dbus_test_diag ("%s directory does not match %s in the match set",
(char *)link->data,
test_system_service_dir_matches[i]);
dbus_free (link->data);
......@@ -3985,7 +3986,7 @@ test_default_system_servicedirs (void)
if (test_system_service_dir_matches[i] != NULL)
{
printf ("extra data %s in the match set was not matched\n",
_dbus_test_diag ("extra data %s in the match set was not matched",
test_system_service_dir_matches[i]);
return FALSE;
......@@ -4001,7 +4002,7 @@ bus_config_parser_test (const DBusString *test_data_dir)
if (test_data_dir == NULL ||
_dbus_string_get_length (test_data_dir) == 0)
{
printf ("No test data\n");
_dbus_test_diag ("No test data");
return TRUE;
}
......@@ -4009,7 +4010,7 @@ bus_config_parser_test (const DBusString *test_data_dir)
return FALSE;
#ifdef DBUS_WIN
printf("default system service dir skipped\n");
_dbus_test_diag ("default system service dir skipped");
#else
if (!test_default_system_servicedirs())
return FALSE;
......
......@@ -29,31 +29,22 @@
#include <stdlib.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-misc.h>
#include <dbus/dbus-test-tap.h>
#if !defined(DBUS_ENABLE_EMBEDDED_TESTS) || !defined(DBUS_UNIX)
#error This file is only relevant for the embedded tests on Unix
#endif
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{
fprintf (stderr, "Unit test failed: %s\n", failure);
exit (1);
}
static void
check_memleaks (const char *name)
{
dbus_shutdown ();
printf ("%s: checking for memleaks\n", name);
_dbus_test_diag ("%s: checking for memleaks", name);
if (_dbus_get_malloc_blocks_outstanding () != 0)
{
_dbus_warn ("%d dbus_malloc blocks were not freed",
_dbus_get_malloc_blocks_outstanding ());
die ("memleaks");
_dbus_test_fatal ("%d dbus_malloc blocks were not freed",
_dbus_get_malloc_blocks_outstanding ());
}
}
......@@ -110,19 +101,14 @@ main (int argc, char **argv)
dir = _dbus_getenv ("DBUS_TEST_DATA");
if (dir == NULL)
{
fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
return 1;
}
_dbus_test_fatal ("Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable");
printf ("%s: Running launch helper OOM checks\n", argv[0]);
_dbus_test_diag ("%s: Running launch helper OOM checks", argv[0]);
if (!_dbus_string_init (&config_file))
return 1;
if (!_dbus_string_append (&config_file, dir))
return 1;
if (!_dbus_string_append (&config_file, "/valid-config-files-system/debug-allow-all-pass.conf"))
return 1;
if (!_dbus_string_init (&config_file) ||
!_dbus_string_append (&config_file, dir) ||
!_dbus_string_append (&config_file, "/valid-config-files-system/debug-allow-all-pass.conf"))
_dbus_test_fatal ("OOM during initialization");
/* use a config file that will actually work... */
dbus_setenv ("TEST_LAUNCH_HELPER_CONFIG",
......@@ -133,11 +119,11 @@ main (int argc, char **argv)
if (!_dbus_test_oom_handling ("dbus-daemon-launch-helper",
bus_activation_helper_oom_test,
(char *) "org.freedesktop.DBus.TestSuiteEchoService"))
die ("OOM failed");
_dbus_test_fatal ("OOM test failed");
test_post_hook (argv[0]);
printf ("%s: Success\n", argv[0]);
_dbus_test_diag ("%s: Success", argv[0]);
return 0;
}
......@@ -29,6 +29,7 @@
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-message-internal.h>
#include <dbus/dbus-test-tap.h>
#include "selinux.h"
#ifndef DBUS_ENABLE_EMBEDDED_TESTS
......@@ -39,26 +40,16 @@
# include <dbus/dbus-sysdeps-unix.h>
#endif
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{
fprintf (stderr, "Unit test failed: %s\n", failure);
exit (1);
}
static void
check_memleaks (const char *name)
{
dbus_shutdown ();
printf ("%s: checking for memleaks\n", name);
_dbus_test_diag ("%s: checking for memleaks", name);
if (_dbus_get_malloc_blocks_outstanding () != 0)
{
_dbus_warn ("%d dbus_malloc blocks were not freed",
_dbus_get_malloc_blocks_outstanding ());
die ("memleaks");
_dbus_test_fatal ("%d dbus_malloc blocks were not freed",
_dbus_get_malloc_blocks_outstanding ());
}
}
......@@ -71,7 +62,7 @@ test_pre_hook (void)
if (_dbus_getenv ("DBUS_TEST_SELINUX")
&& (!bus_selinux_pre_init ()
|| !bus_selinux_full_init ()))
die ("could not init selinux support");
_dbus_test_fatal ("Could not init selinux support");
initial_fds = _dbus_check_fdleaks_enter ();
}
......@@ -109,10 +100,7 @@ main (int argc, char **argv)
only = NULL;
if (dir == NULL)
{
fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
return 1;
}
_dbus_test_fatal ("Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable");
_dbus_string_init_const (&test_data_dir, dir);
......@@ -122,59 +110,59 @@ main (int argc, char **argv)
#endif
if (!_dbus_threads_init_debug ())
die ("initializing debug threads");
_dbus_test_fatal ("OOM initializing debug threads");
if (only == NULL || strcmp (only, "expire-list") == 0)
{
test_pre_hook ();
printf ("%s: Running expire list test\n", argv[0]);
_dbus_test_diag ("%s: Running expire list test", argv[0]);
if (!bus_expire_list_test (&test_data_dir))
die ("expire list");
_dbus_test_fatal ("expire list test failed");
test_post_hook ();
}
if (only == NULL || strcmp (only, "config-parser") == 0)
{
test_pre_hook ();
printf ("%s: Running config file parser test\n", argv[0]);
_dbus_test_diag ("%s: Running config file parser test", argv[0]);
if (!bus_config_parser_test (&test_data_dir))
die ("parser");
_dbus_test_fatal ("parser test failed");
test_post_hook ();
}
if (only == NULL || strcmp (only, "signals") == 0)
{
test_pre_hook ();
printf ("%s: Running signals test\n", argv[0]);
_dbus_test_diag ("%s: Running signals test", argv[0]);
if (!bus_signals_test (&test_data_dir))
die ("signals");
_dbus_test_fatal ("signals test failed");
test_post_hook ();
}
if (only == NULL || strcmp (only, "dispatch-sha1") == 0)
{
test_pre_hook ();
printf ("%s: Running SHA1 connection test\n", argv[0]);
_dbus_test_diag ("%s: Running SHA1 connection test", argv[0]);
if (!bus_dispatch_sha1_test (&test_data_dir))
die ("sha1");
_dbus_test_fatal ("sha1 test failed");
test_post_hook ();
}
if (only == NULL || strcmp (only, "dispatch") == 0)
{
test_pre_hook ();
printf ("%s: Running message dispatch test\n", argv[0]);
_dbus_test_diag ("%s: Running message dispatch test", argv[0]);
if (!bus_dispatch_test (&test_data_dir))
die ("dispatch");
_dbus_test_fatal ("dispatch test failed");
test_post_hook ();
}
if (only == NULL || strcmp (only, "activation-service-reload") == 0)
{
test_pre_hook ();
printf ("%s: Running service files reloading test\n", argv[0]);
_dbus_test_diag ("%s: Running service files reloading test", argv[0]);
if (!bus_activation_service_reload_test (&test_data_dir))
die ("service reload");
_dbus_test_fatal ("service reload test failed");
test_post_hook ();
}
......@@ -182,15 +170,14 @@ main (int argc, char **argv)
if (only == NULL || strcmp (only, "unix-fds-passing") == 0)
{
test_pre_hook ();
printf ("%s: Running unix fd passing test\n", argv[0]);
_dbus_test_diag ("%s: Running unix fd passing test", argv[0]);
if (!bus_unix_fds_passing_test (&test_data_dir))
die ("unix fd passing");
_dbus_test_fatal ("unix fd passing test failed");
test_post_hook ();
}
#endif
printf ("%s: Success\n", argv[0]);
_dbus_test_diag ("%s: Success", argv[0]);
return 0;
}
......@@ -28,31 +28,22 @@
#include <dbus/dbus-string.h>
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-test-tap.h>
#if !defined(DBUS_ENABLE_EMBEDDED_TESTS) || !defined(DBUS_UNIX)
#error This file is only relevant for the embedded tests on Unix
#endif
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{
fprintf (stderr, "Unit test failed: %s\n", failure);
exit (1);
}
static void
check_memleaks (const char *name)
{
dbus_shutdown ();
printf ("%s: checking for memleaks\n", name);
_dbus_test_diag ("%s: checking for memleaks", name);
if (_dbus_get_malloc_blocks_outstanding () != 0)
{
_dbus_warn ("%d dbus_malloc blocks were not freed",
_dbus_get_malloc_blocks_outstanding ());
die ("memleaks");
_dbus_test_fatal ("%d dbus_malloc blocks were not freed",
_dbus_get_malloc_blocks_outstanding ());
}
}
......@@ -82,23 +73,20 @@ main (int argc, char **argv)
dir = _dbus_getenv ("DBUS_TEST_DATA");
if (dir == NULL)
{
fprintf (stderr, "Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable\n");
return 1;
}
_dbus_test_fatal ("Must specify test data directory as argv[1] or in DBUS_TEST_DATA env variable");
_dbus_string_init_const (&test_data_dir, dir);
if (!_dbus_threads_init_debug ())
die ("initializing debug threads");
_dbus_test_fatal ("OOM initializing debug threads");
test_pre_hook ();
printf ("%s: Running config file parser (trivial) test\n", argv[0]);
_dbus_test_diag ("%s: Running config file parser (trivial) test", argv[0]);
if (!bus_config_parser_trivial_test (&test_data_dir))
die ("parser");
_dbus_test_fatal ("OOM creating parser");
test_post_hook ();
printf ("%s: Success\n", argv[0]);
_dbus_test_diag ("%s: Success", argv[0]);
return 0;
}
......@@ -33,6 +33,7 @@
#include "dbus-hash.h"
#include "dbus-credentials.h"
#include "dbus-internals.h"
#include <dbus/dbus-test-tap.h>
/**
* @defgroup DBusAuthScript code for running unit test scripts for DBusAuth
......@@ -346,7 +347,7 @@ _dbus_auth_script_run (const DBusString *filename)
"UNIX_ONLY"))
{
/* skip this file */
fprintf (stderr, "skipping unix only auth script\n");
_dbus_test_diag ("skipping unix only auth script");
retval = TRUE;
goto out;
}
......@@ -362,7 +363,7 @@ _dbus_auth_script_run (const DBusString *filename)
"WIN_ONLY"))
{
/* skip this file */
fprintf (stderr, "skipping windows only auth script\n");
_dbus_test_diag ("skipping windows only auth script");
retval = TRUE;
goto out;
}
......
......@@ -25,6 +25,7 @@
#include "dbus-internals.h"
#include "dbus-test.h"
#include "dbus-auth.h"
#include <dbus/dbus-test-tap.h>
/**
* @addtogroup DBusAuth
......@@ -76,8 +77,8 @@ process_test_subdir (const DBusString *test_base_dir,
goto failed;
}
printf ("Testing %s:\n", subdir);
_dbus_test_diag ("Testing %s:", subdir);
next:
while (_dbus_directory_get_next_file (dir, &filename, &error))
{
......@@ -100,8 +101,8 @@ process_test_subdir (const DBusString *test_base_dir,
goto next;
}
printf (" %s\n", _dbus_string_get_const_data (&filename));
_dbus_test_diag (" %s", _dbus_string_get_const_data (&filename));
if (!_dbus_auth_script_run (&full_path))
{
_dbus_string_free (&full_path);
......
......@@ -78,6 +78,7 @@
#include "dbus-hash.h"
#include "dbus-internals.h"
#include "dbus-mempool.h"
#include <dbus/dbus-test-tap.h>
/**
* @defgroup DBusHashTable Hash table
......@@ -1608,7 +1609,7 @@ _dbus_hash_test (void)
_dbus_assert_not_reached ("no memory");
}
printf ("Computing test hash keys...\n");
_dbus_test_diag ("Computing test hash keys...");
i = 0;
while (i < N_HASH_KEYS)
{
......@@ -1618,8 +1619,8 @@ _dbus_hash_test (void)
_dbus_assert (*(keys[i] + len) == '\0');
++i;
}
printf ("... done.\n");
_dbus_test_diag ("... done.");
table1 = _dbus_hash_table_new (DBUS_HASH_STRING,
dbus_free, dbus_free);
if (table1 == NULL)
......
......@@ -27,6 +27,7 @@
#include <dbus/dbus-string.h>
#include <dbus/dbus-list.h>
#include <dbus/dbus-sysdeps.h>
#include <dbus/dbus-test-tap.h>
/**
* @defgroup DBusKeyring keyring class
......@@ -1128,7 +1129,7 @@ _dbus_keyring_test (void)
++i;
}
printf (" %d keys in test\n", ring1->n_keys);
_dbus_test_diag (" %d keys in test", ring1->n_keys);
/* Test ref/unref */
_dbus_keyring_ref (ring1);
......
......@@ -26,6 +26,7 @@
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
#include "dbus-marshal-byteswap.h"
#include "dbus-test.h"
#include <dbus/dbus-test-tap.h>
#include <stdio.h>
static void
......@@ -89,7 +90,7 @@ do_byteswap_test (int byte_order)
_dbus_string_free (&signature);
_dbus_string_free (&body);
printf (" %d blocks swapped from order '%c' to '%c'\n",
_dbus_test_diag (" %d blocks swapped from order '%c' to '%c'",
sequence, byte_order, opposite_order);
}
......
......@@ -29,6 +29,7 @@
#include "dbus-message-private.h"
#include "dbus-signature.h"
#include "dbus-test.h"
#include <dbus/dbus-test-tap.h>
#include <stdio.h>
typedef enum
......@@ -1081,7 +1082,7 @@ generate_typecode_changed (DBusMessageDataIter *iter,
_dbus_assert (iter->depth == (base_depth + 0));
#if 0
printf ("Changing byte %d in message %d to %c\n",
_dbus_test_diag ("Changing byte %d in message %d to %c",
byte_seq, iter_get_sequence (iter), typecodes[typecode_seq]);
#endif
......@@ -1199,15 +1200,15 @@ generate_uint32_changed (DBusMessageDataIter *iter,
}
#if 0
printf ("body %d change %d pos %d ",
_dbus_test_diag ("body %d change %d pos %d ",
body_seq, change_seq, byte_seq);
if (change->type == CHANGE_TYPE_ADJUST)
printf ("adjust by %d", (int) change->value);
_dbus_test_diag ("adjust by %d", (int) change->value);
else
printf ("set to %u", change->value);
_dbus_test_diag ("set to %u", change->value);
printf (" \t%u -> %u\n",
_dbus_test_diag (" \t%u -> %u",
_dbus_marshal_read_uint32 (data, byte_seq, byte_order, NULL),
v_UINT32);
#endif
......@@ -1279,8 +1280,7 @@ _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
if (iter_first_in_series (iter))
{
printf (" testing message loading: %s ", generators[generator].name);
fflush (stdout);
_dbus_test_diag (" testing message loading: %s ", generators[generator].name);
}
func = generators[generator].func;
......@@ -1296,7 +1296,7 @@ _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
iter_unrecurse (iter);
iter_next (iter); /* next generator */
_dbus_string_free (&data->data);
printf ("%d test loads cumulative\n", iter->count);
_dbus_test_diag ("%d test loads cumulative", iter->count);
goto restart;
}
iter_unrecurse (iter);
......
......@@ -31,6 +31,7 @@
#ifdef HAVE_UNIX_FD_PASSING