From b530b7de4829132c873dcb7c630fba06029979db Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Fri, 28 Jun 2013 16:25:54 +0800 Subject: [PATCH 4/5] tests to embedded tests: replaced in libdbus Signed-off-by: Chengwei Yang --- dbus/dbus-address.c | 2 +- dbus/dbus-auth-script.c | 4 ++-- dbus/dbus-auth-util.c | 4 ++-- dbus/dbus-connection-internal.h | 2 +- dbus/dbus-connection.c | 4 ++-- dbus/dbus-credentials-util.c | 4 ++-- dbus/dbus-dataslot.c | 4 ++-- dbus/dbus-hash.c | 4 ++-- dbus/dbus-internals.c | 6 +++--- dbus/dbus-internals.h | 4 ++-- dbus/dbus-keyring.c | 6 +++--- dbus/dbus-list.c | 2 +- dbus/dbus-mainloop.c | 2 +- dbus/dbus-marshal-basic.c | 4 ++-- dbus/dbus-marshal-byteswap-util.c | 4 ++-- dbus/dbus-marshal-recursive-util.c | 4 ++-- dbus/dbus-marshal-validate-util.c | 4 ++-- dbus/dbus-memory.c | 30 +++++++++++++++--------------- dbus/dbus-mempool.c | 14 +++++++------- dbus/dbus-message-factory.c | 4 ++-- dbus/dbus-message-factory.h | 4 ++-- dbus/dbus-message-util.c | 8 ++++---- dbus/dbus-message.c | 2 +- dbus/dbus-misc.c | 2 +- dbus/dbus-object-tree.c | 28 ++++++++++++++-------------- dbus/dbus-server-debug-pipe.c | 4 ++-- dbus/dbus-server.c | 8 ++++---- dbus/dbus-sha.c | 4 ++-- dbus/dbus-signature.c | 2 +- dbus/dbus-socket-set-poll.c | 2 +- dbus/dbus-spawn-win.c | 10 +++++----- dbus/dbus-spawn.c | 6 +++--- dbus/dbus-string-util.c | 4 ++-- dbus/dbus-string.c | 16 ++++++++-------- dbus/dbus-sysdeps-unix.c | 2 +- dbus/dbus-sysdeps-util.c | 4 ++-- dbus/dbus-sysdeps-win.c | 4 ++-- dbus/dbus-test.c | 6 +++--- dbus/dbus-threads.c | 4 ++-- dbus/dbus-transport-unix.c | 2 +- dbus/dbus-transport.c | 4 ++-- dbus/dbus-userdb-util.c | 4 ++-- dbus/dbus-userdb.c | 4 ++-- 43 files changed, 123 insertions(+), 123 deletions(-) diff --git a/dbus/dbus-address.c b/dbus/dbus-address.c index 90484dc..7bfdee6 100644 --- a/dbus/dbus-address.c +++ b/dbus/dbus-address.c @@ -648,7 +648,7 @@ dbus_address_unescape_value (const char *value, /** @} */ /* End of public API */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c index cbdd748..c1f0c88 100644 --- a/dbus/dbus-auth-script.c +++ b/dbus/dbus-auth-script.c @@ -22,7 +22,7 @@ */ #include -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-auth-script.h" #include "dbus-auth.h" @@ -800,4 +800,4 @@ _dbus_auth_script_run (const DBusString *filename) } /** @} */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-auth-util.c b/dbus/dbus-auth-util.c index 776e8e2..e88d669 100644 --- a/dbus/dbus-auth-util.c +++ b/dbus/dbus-auth-util.c @@ -33,7 +33,7 @@ /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include "dbus-auth-script.h" #include @@ -167,4 +167,4 @@ _dbus_auth_test (const char *test_data_dir) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 3d37f18..2842f2f 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -115,7 +115,7 @@ void _dbus_connection_get_stats (DBusConnection *connection, dbus_uint32_t *out_peak_fds); -/* if DBUS_BUILD_TESTS */ +/* if DBUS_ENABLE_EMBEDDED_TESTS */ const char* _dbus_connection_get_address (DBusConnection *connection); /* This _dbus_bus_* stuff doesn't really belong here, but dbus-bus-internal.h seems diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index fda334a..86adaa5 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -446,7 +446,7 @@ _dbus_connection_wakeup_mainloop (DBusConnection *connection) (*connection->wakeup_main_function) (connection->wakeup_main_data); } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Gets the locks so we can examine them * @@ -6283,7 +6283,7 @@ dbus_connection_get_outgoing_unix_fds (DBusConnection *connection) return res; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Returns the address of the transport object of this connection * diff --git a/dbus/dbus-credentials-util.c b/dbus/dbus-credentials-util.c index 59cdcb8..d2d164f 100644 --- a/dbus/dbus-credentials-util.c +++ b/dbus/dbus-credentials-util.c @@ -33,7 +33,7 @@ /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include #include @@ -203,4 +203,4 @@ _dbus_credentials_test (const char *test_data_dir) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-dataslot.c b/dbus/dbus-dataslot.c index 412e7f4..e37c9dd 100644 --- a/dbus/dbus-dataslot.c +++ b/dbus/dbus-dataslot.c @@ -348,7 +348,7 @@ _dbus_data_slot_list_free (DBusDataSlotList *list) /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -459,4 +459,4 @@ _dbus_data_slot_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-hash.c b/dbus/dbus-hash.c index c4c6f93..c80835a 100644 --- a/dbus/dbus-hash.c +++ b/dbus/dbus-hash.c @@ -1401,7 +1401,7 @@ _dbus_hash_table_get_n_entries (DBusHashTable *table) /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -1828,4 +1828,4 @@ _dbus_hash_test (void) return ret; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 63559be..257f1d4 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -861,7 +861,7 @@ _dbus_get_local_machine_uuid_encoded (DBusString *uuid_str) if (!_dbus_read_local_machine_uuid (&machine_uuid, FALSE, &error)) { -#ifndef DBUS_BUILD_TESTS +#ifndef DBUS_ENABLE_EMBEDDED_TESTS /* For the test suite, we may not be installed so just continue silently * here. But in a production build, we want to be nice and loud about * this. @@ -940,7 +940,7 @@ _dbus_real_assert_not_reached (const char *explanation, } #endif /* DBUS_DISABLE_ASSERT */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static dbus_bool_t run_failing_each_malloc (int n_mallocs, const char *description, @@ -1035,6 +1035,6 @@ _dbus_test_oom_handling (const char *description, return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ /** @} */ diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index ca011a5..0856f8f 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -266,7 +266,7 @@ void _dbus_verbose_bytes_of_string (const DBusString *str, extern const char *_dbus_no_memory_message; #define _DBUS_SET_OOM(error) dbus_set_error_const ((error), DBUS_ERROR_NO_MEMORY, _dbus_no_memory_message) -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /* Memory debugging */ void _dbus_set_fail_alloc_counter (int until_next_fail); int _dbus_get_fail_alloc_counter (void); @@ -290,7 +290,7 @@ dbus_bool_t _dbus_test_oom_handling (const char *description, #define _dbus_decrement_fail_alloc_counter() (FALSE) #define _dbus_disable_mem_pools() (FALSE) #define _dbus_get_malloc_blocks_outstanding (0) -#endif /* !DBUS_BUILD_TESTS */ +#endif /* !DBUS_ENABLE_EMBEDDED_TESTS */ typedef void (* DBusShutdownFunction) (void *data); dbus_bool_t _dbus_register_shutdown_func (DBusShutdownFunction function, diff --git a/dbus/dbus-keyring.c b/dbus/dbus-keyring.c index 3b9ce31..0e433a8 100644 --- a/dbus/dbus-keyring.c +++ b/dbus/dbus-keyring.c @@ -80,7 +80,7 @@ * Maximum number of keys in the keyring before * we just ignore the rest */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #define MAX_KEYS_IN_FILE 10 #else #define MAX_KEYS_IN_FILE 256 @@ -1023,7 +1023,7 @@ _dbus_keyring_get_hex_key (DBusKeyring *keyring, /** @} */ /* end of exposed API */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -1156,5 +1156,5 @@ _dbus_keyring_test (void) return FALSE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-list.c b/dbus/dbus-list.c index 525e067..c4c1856 100644 --- a/dbus/dbus-list.c +++ b/dbus/dbus-list.c @@ -788,7 +788,7 @@ _dbus_list_length_is_one (DBusList **list) /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include diff --git a/dbus/dbus-mainloop.c b/dbus/dbus-mainloop.c index cef676a..457242d 100644 --- a/dbus/dbus-mainloop.c +++ b/dbus/dbus-mainloop.c @@ -922,7 +922,7 @@ _dbus_loop_quit (DBusLoop *loop) int _dbus_get_oom_wait (void) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /* make tests go fast */ return 0; #else diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c index 88b19f3..cdbac58 100644 --- a/dbus/dbus-marshal-basic.c +++ b/dbus/dbus-marshal-basic.c @@ -1501,7 +1501,7 @@ _dbus_first_type_in_signature_c_str (const char *str, /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -1992,4 +1992,4 @@ _dbus_marshal_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-marshal-byteswap-util.c b/dbus/dbus-marshal-byteswap-util.c index edb74ca..5787485 100644 --- a/dbus/dbus-marshal-byteswap-util.c +++ b/dbus/dbus-marshal-byteswap-util.c @@ -23,7 +23,7 @@ #include -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-marshal-byteswap.h" #include "dbus-test.h" #include @@ -102,4 +102,4 @@ _dbus_marshal_byteswap_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-marshal-recursive-util.c b/dbus/dbus-marshal-recursive-util.c index 9512414..6d62983 100644 --- a/dbus/dbus-marshal-recursive-util.c +++ b/dbus/dbus-marshal-recursive-util.c @@ -23,7 +23,7 @@ #include -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-marshal-recursive.h" #include "dbus-marshal-basic.h" @@ -3574,4 +3574,4 @@ container_destroy (TestTypeNode *node) #endif /* !DOXYGEN_SHOULD_SKIP_THIS */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-marshal-validate-util.c b/dbus/dbus-marshal-validate-util.c index 81135bc..d52cb6d 100644 --- a/dbus/dbus-marshal-validate-util.c +++ b/dbus/dbus-marshal-validate-util.c @@ -22,7 +22,7 @@ */ #include -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -585,4 +585,4 @@ _dbus_marshal_validate_test (void) #endif /* !DOXYGEN_SHOULD_SKIP_THIS */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-memory.c b/dbus/dbus-memory.c index 6cf0449..d59e8f8 100644 --- a/dbus/dbus-memory.c +++ b/dbus/dbus-memory.c @@ -97,7 +97,7 @@ * @{ */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static dbus_bool_t debug_initialized = FALSE; static int fail_nth = -1; static size_t fail_size = 0; @@ -240,7 +240,7 @@ _dbus_get_fail_alloc_failures (void) return n_failures_per_failure; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Called when about to alloc some memory; if * it returns #TRUE, then the allocation should @@ -294,7 +294,7 @@ _dbus_decrement_fail_alloc_counter (void) return FALSE; } } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ /** * Get the number of outstanding malloc()'d blocks. @@ -460,7 +460,7 @@ set_guards (void *real_block, void* dbus_malloc (size_t bytes) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_initialize_malloc_debug (); if (_dbus_decrement_fail_alloc_counter ()) @@ -472,7 +472,7 @@ dbus_malloc (size_t bytes) if (bytes == 0) /* some system mallocs handle this, some don't */ return NULL; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS else if (fail_size != 0 && bytes > fail_size) return NULL; else if (guards) @@ -499,7 +499,7 @@ dbus_malloc (size_t bytes) void *mem; mem = malloc (bytes); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (mem) { _dbus_atomic_inc (&n_blocks_outstanding); @@ -530,7 +530,7 @@ dbus_malloc (size_t bytes) void* dbus_malloc0 (size_t bytes) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_initialize_malloc_debug (); if (_dbus_decrement_fail_alloc_counter ()) @@ -543,7 +543,7 @@ dbus_malloc0 (size_t bytes) if (bytes == 0) return NULL; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS else if (fail_size != 0 && bytes > fail_size) return NULL; else if (guards) @@ -571,7 +571,7 @@ dbus_malloc0 (size_t bytes) void *mem; mem = calloc (bytes, 1); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (mem) { _dbus_atomic_inc (&n_blocks_outstanding); @@ -601,7 +601,7 @@ void* dbus_realloc (void *memory, size_t bytes) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_initialize_malloc_debug (); if (_dbus_decrement_fail_alloc_counter ()) @@ -617,7 +617,7 @@ dbus_realloc (void *memory, dbus_free (memory); return NULL; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS else if (fail_size != 0 && bytes > fail_size) return NULL; else if (guards) @@ -677,7 +677,7 @@ dbus_realloc (void *memory, void *mem; mem = realloc (memory, bytes); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (mem == NULL && malloc_cannot_fail) { _dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes); @@ -700,7 +700,7 @@ dbus_realloc (void *memory, void dbus_free (void *memory) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (guards) { check_guards (memory, TRUE); @@ -724,7 +724,7 @@ dbus_free (void *memory) if (memory) /* we guarantee it's safe to free (NULL) */ { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #ifdef DBUS_DISABLE_ASSERT _dbus_atomic_dec (&n_blocks_outstanding); #else @@ -912,7 +912,7 @@ dbus_shutdown (void) /** @} */ /** End of public API docs block */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" /** diff --git a/dbus/dbus-mempool.c b/dbus/dbus-mempool.c index f153993..e744585 100644 --- a/dbus/dbus-mempool.c +++ b/dbus/dbus-mempool.c @@ -213,7 +213,7 @@ _dbus_mem_pool_free (DBusMemPool *pool) void* _dbus_mem_pool_alloc (DBusMemPool *pool) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (_dbus_disable_mem_pools ()) { DBusMemBlock *block; @@ -280,7 +280,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool) /* Need a new block */ DBusMemBlock *block; int alloc_size; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS int saved_counter; #endif @@ -294,7 +294,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool) alloc_size = sizeof (DBusMemBlock) - ELEMENT_PADDING + pool->block_size; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /* We save/restore the counter, so that memory pools won't * cause a given function to have different number of * allocations on different invocations. i.e. when testing @@ -310,7 +310,7 @@ _dbus_mem_pool_alloc (DBusMemPool *pool) else block = dbus_malloc (alloc_size); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_set_fail_alloc_counter (saved_counter); _dbus_assert (saved_counter == _dbus_get_fail_alloc_counter ()); #endif @@ -349,7 +349,7 @@ _dbus_mem_pool_dealloc (DBusMemPool *pool, { VALGRIND_MEMPOOL_FREE (pool, element); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (_dbus_disable_mem_pools ()) { DBusMemBlock *block; @@ -449,7 +449,7 @@ _dbus_mem_pool_get_stats (DBusMemPool *pool, /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include #include @@ -644,4 +644,4 @@ _dbus_mem_pool_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-message-factory.c b/dbus/dbus-message-factory.c index efa4e02..b742e4c 100644 --- a/dbus/dbus-message-factory.c +++ b/dbus/dbus-message-factory.c @@ -24,7 +24,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-message-factory.h" #include "dbus-message-private.h" #include "dbus-signature.h" @@ -1302,4 +1302,4 @@ _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter, #endif /* !DOXYGEN_SHOULD_SKIP_THIS */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-message-factory.h b/dbus/dbus-message-factory.h index b074750..fd7a476 100644 --- a/dbus/dbus-message-factory.h +++ b/dbus/dbus-message-factory.h @@ -24,7 +24,7 @@ #ifndef DBUS_MESSAGE_FACTORY_H #define DBUS_MESSAGE_FACTORY_H -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include #include @@ -56,6 +56,6 @@ dbus_bool_t _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter, DBUS_END_DECLS -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ #endif /* DBUS_MESSAGE_FACTORY_H */ diff --git a/dbus/dbus-message-util.c b/dbus/dbus-message-util.c index f785952..a5ce510 100644 --- a/dbus/dbus-message-util.c +++ b/dbus/dbus-message-util.c @@ -45,7 +45,7 @@ * @{ */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Reads arguments from a message iterator given a variable argument * list. Only arguments of basic type and arrays of fixed-length @@ -76,11 +76,11 @@ dbus_message_iter_get_args (DBusMessageIter *iter, return retval; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include "dbus-message-factory.h" #include @@ -1542,4 +1542,4 @@ _dbus_message_test (const char *test_data_dir) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 3f97ef2..5d3517c 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -56,7 +56,7 @@ static void dbus_message_finalize (DBusMessage *message); * @{ */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static dbus_bool_t _dbus_enable_message_cache (void) { diff --git a/dbus/dbus-misc.c b/dbus/dbus-misc.c index b161013..6ca30f2 100644 --- a/dbus/dbus-misc.c +++ b/dbus/dbus-misc.c @@ -173,7 +173,7 @@ dbus_get_version (int *major_version_p, /** @} */ /* End of public API */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/dbus/dbus-object-tree.c b/dbus/dbus-object-tree.c index 172c9d9..086fc64 100644 --- a/dbus/dbus-object-tree.c +++ b/dbus/dbus-object-tree.c @@ -503,7 +503,7 @@ unlock: connection = tree->connection; /* Unlock and call application code */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (connection) #endif { @@ -515,7 +515,7 @@ unlock: if (unregister_function) (* unregister_function) (connection, user_data); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (connection) #endif dbus_connection_unref (connection); @@ -638,7 +638,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree, DBUS_INTERFACE_INTROSPECTABLE, "Introspect")) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -653,7 +653,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree, if (!_dbus_string_init (&xml)) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -698,7 +698,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree, if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &v_STRING)) goto out; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -711,7 +711,7 @@ handle_default_introspect_and_unlock (DBusObjectTree *tree, result = DBUS_HANDLER_RESULT_HANDLED; out: -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -762,7 +762,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree, path = NULL; if (!dbus_message_get_path_decomposed (message, &path)) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -777,7 +777,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree, if (path == NULL) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -846,7 +846,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree, _dbus_verbose (" (invoking a handler)\n"); #endif -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -863,7 +863,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree, message, user_data); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif _dbus_connection_lock (tree->connection); @@ -886,7 +886,7 @@ _dbus_object_tree_dispatch_and_unlock (DBusObjectTree *tree, } else { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -1057,7 +1057,7 @@ _dbus_object_tree_list_registered_and_unlock (DBusObjectTree *tree, parent_path, child_entries); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (tree->connection) #endif { @@ -1214,7 +1214,7 @@ flatten_path (const char **path) } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -1962,4 +1962,4 @@ _dbus_object_tree_test (void) #endif /* !DOXYGEN_SHOULD_SKIP_THIS */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-server-debug-pipe.c b/dbus/dbus-server-debug-pipe.c index 419db5c..8f5ff5f 100644 --- a/dbus/dbus-server-debug-pipe.c +++ b/dbus/dbus-server-debug-pipe.c @@ -31,7 +31,7 @@ #include "dbus-string.h" #include "dbus-protocol.h" -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * @defgroup DBusServerDebugPipe DBusServerDebugPipe @@ -427,5 +427,5 @@ _dbus_transport_open_debug_pipe (DBusAddressEntry *entry, /** @} */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-server.c b/dbus/dbus-server.c index e021266..efe7d1d 100644 --- a/dbus/dbus-server.c +++ b/dbus/dbus-server.c @@ -26,7 +26,7 @@ #include "dbus-server-unix.h" #include "dbus-server-socket.h" #include "dbus-string.h" -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-server-debug-pipe.h" #endif #include "dbus-address.h" @@ -529,7 +529,7 @@ static const struct { } listen_funcs[] = { { _dbus_server_listen_socket } , { _dbus_server_listen_platform_specific } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS , { _dbus_server_listen_debug_pipe } #endif }; @@ -1188,7 +1188,7 @@ dbus_server_get_data (DBusServer *server, /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -1244,4 +1244,4 @@ _dbus_server_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-sha.c b/dbus/dbus-sha.c index d182752..febfba2 100644 --- a/dbus/dbus-sha.c +++ b/dbus/dbus-sha.c @@ -511,7 +511,7 @@ _dbus_sha_compute (const DBusString *data, /** @} */ /* end of exported functions */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -966,4 +966,4 @@ _dbus_sha_test (const char *test_data_dir) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-signature.c b/dbus/dbus-signature.c index c130de5..8a4701c 100644 --- a/dbus/dbus-signature.c +++ b/dbus/dbus-signature.c @@ -410,7 +410,7 @@ dbus_type_is_valid (int typecode) /** @} */ /* end of DBusSignature group */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * @ingroup DBusSignatureInternals diff --git a/dbus/dbus-socket-set-poll.c b/dbus/dbus-socket-set-poll.c index 65a1fd2..e322a3b 100644 --- a/dbus/dbus-socket-set-poll.c +++ b/dbus/dbus-socket-set-poll.c @@ -44,7 +44,7 @@ typedef struct { #define MINIMUM_SIZE 8 /* If we're in the regression tests, force reallocation to happen sooner */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #define DEFAULT_SIZE_HINT 1 #else #define DEFAULT_SIZE_HINT MINIMUM_SIZE diff --git a/dbus/dbus-spawn-win.c b/dbus/dbus-spawn-win.c index 3dae4f3..cd8ca66 100644 --- a/dbus/dbus-spawn-win.c +++ b/dbus/dbus-spawn-win.c @@ -63,7 +63,7 @@ struct DBusBabysitter int refcount; HANDLE start_sync_event; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS HANDLE end_sync_event; #endif @@ -109,7 +109,7 @@ _dbus_babysitter_new (void) return NULL; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS sitter->end_sync_event = CreateEvent (NULL, FALSE, FALSE, NULL); if (sitter->end_sync_event == NULL) { @@ -250,7 +250,7 @@ _dbus_babysitter_unref (DBusBabysitter *sitter) sitter->start_sync_event = NULL; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (sitter->end_sync_event != NULL) { CloseHandle (sitter->end_sync_event); @@ -628,7 +628,7 @@ babysitter (void *parameter) sitter->child_handle = NULL; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS SetEvent (sitter->end_sync_event); #endif @@ -753,7 +753,7 @@ _dbus_babysitter_set_result_function (DBusBabysitter *sitter, sitter->finished_data = user_data; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static char * get_test_exec (const char *exe, diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c index 55a7e1e..f8d5fd1 100644 --- a/dbus/dbus-spawn.c +++ b/dbus/dbus-spawn.c @@ -936,7 +936,7 @@ do_exec (int child_err_report_fd, DBusSpawnChildSetupFunc child_setup, void *user_data) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS int i, max_open; #endif @@ -947,7 +947,7 @@ do_exec (int child_err_report_fd, if (child_setup) (* child_setup) (user_data); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS max_open = sysconf (_SC_OPEN_MAX); for (i = 3; i < max_open; i++) @@ -1325,7 +1325,7 @@ _dbus_babysitter_set_result_function (DBusBabysitter *sitter, /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static char * get_test_exec (const char *exe, diff --git a/dbus/dbus-string-util.c b/dbus/dbus-string-util.c index 922580d..3babc05 100644 --- a/dbus/dbus-string-util.c +++ b/dbus/dbus-string-util.c @@ -115,7 +115,7 @@ _dbus_string_find_byte_backward (const DBusString *str, /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" #include @@ -935,4 +935,4 @@ _dbus_string_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c index 52eb0f2..eee86de 100644 --- a/dbus/dbus-string.c +++ b/dbus/dbus-string.c @@ -285,9 +285,9 @@ compact (DBusRealString *real, return TRUE; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /* Not using this feature at the moment, - * so marked DBUS_BUILD_TESTS-only + * so marked DBUS_ENABLE_EMBEDDED_TESTS-only */ /** * Locks a string such that any attempts to change the string will @@ -311,7 +311,7 @@ _dbus_string_lock (DBusString *str) #define MAX_WASTE 48 compact (real, MAX_WASTE); } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ static dbus_bool_t reallocate_for_length (DBusRealString *real, @@ -337,11 +337,11 @@ reallocate_for_length (DBusRealString *real, */ #ifdef DBUS_DISABLE_ASSERT #else -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS new_allocated = 0; /* ensure a realloc every time so that we go * through all malloc failure codepaths */ -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ #endif /* !DBUS_DISABLE_ASSERT */ /* But be sure we always alloc at least space for the new length */ @@ -1904,7 +1904,7 @@ _dbus_string_skip_white_reverse (const DBusString *str, * @todo owen correctly notes that this is a stupid function (it was * written purely for test code, * e.g. dbus-message-builder.c). Probably should be enforced as test - * code only with ifdef DBUS_BUILD_TESTS + * code only with ifdef DBUS_ENABLE_EMBEDDED_TESTS * * @param source the source string * @param dest the destination string (contents are replaced) @@ -1948,7 +1948,7 @@ _dbus_string_pop_line (DBusString *source, return TRUE; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Deletes up to and including the first blank space * in the string. @@ -1967,7 +1967,7 @@ _dbus_string_delete_first_word (DBusString *str) } #endif -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Deletes any leading blanks in the string * diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 4a586c7..c2e6f9f 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3923,7 +3923,7 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory, if (!_dbus_homedir_from_uid (uid, &homedir)) goto failed; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS { const char *override; diff --git a/dbus/dbus-sysdeps-util.c b/dbus/dbus-sysdeps-util.c index 4b3d16f..6b361ef 100644 --- a/dbus/dbus-sysdeps-util.c +++ b/dbus/dbus-sysdeps-util.c @@ -80,7 +80,7 @@ _dbus_get_environment (void) return environment; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static void check_dirname (const char *filename, const char *dirname) @@ -196,4 +196,4 @@ _dbus_sysdeps_test (void) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 6621af7..c2ba30a 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -2221,7 +2221,7 @@ _dbus_replace_install_prefix (const char *configure_time_path) #endif } -#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_BUILD_TESTS) +#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_ENABLE_EMBEDDED_TESTS) #if defined(_MSC_VER) || defined(DBUS_WINCE) # ifdef BACKTRACES @@ -3457,7 +3457,7 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory, _dbus_string_append(&homedir,homepath); } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS { const char *override; diff --git a/dbus/dbus-test.c b/dbus/dbus-test.c index 224a6c8..1539bce 100644 --- a/dbus/dbus-test.c +++ b/dbus/dbus-test.c @@ -28,7 +28,7 @@ #include #include -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static void die (const char *failure) { @@ -84,7 +84,7 @@ run_data_test (const char *test_name, } } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ /** * An exported symbol to be run in order to execute @@ -98,7 +98,7 @@ run_data_test (const char *test_name, void dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *specific_test) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (!_dbus_threads_init_debug ()) die ("debug threads init"); diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c index 1781bda..45b262d 100644 --- a/dbus/dbus-threads.c +++ b/dbus/dbus-threads.c @@ -457,7 +457,7 @@ dbus_threads_init_default (void) /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS dbus_bool_t _dbus_threads_init_debug (void) @@ -465,4 +465,4 @@ _dbus_threads_init_debug (void) return dbus_threads_init (NULL); } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c index 6ba5c0b..9a9fea5 100644 --- a/dbus/dbus-transport-unix.c +++ b/dbus/dbus-transport-unix.c @@ -412,7 +412,7 @@ _dbus_transport_open_platform_specific (DBusAddressEntry *entry, /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS dbus_bool_t _dbus_transport_unix_test (void) diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index c483d76..fff76cc 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -32,7 +32,7 @@ #include "dbus-credentials.h" #include "dbus-mainloop.h" #include "dbus-message.h" -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-server-debug-pipe.h" #endif @@ -348,7 +348,7 @@ static const struct { { _dbus_transport_open_socket }, { _dbus_transport_open_platform_specific }, { _dbus_transport_open_autolaunch } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS , { _dbus_transport_open_debug_pipe } #endif }; diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index 38ea4ef..62495d8 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -437,7 +437,7 @@ _dbus_groups_from_uid (dbus_uid_t uid, } /** @} */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include /** @@ -490,4 +490,4 @@ _dbus_userdb_test (const char *test_data_dir) return TRUE; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c index 73f8fce..b792cbe 100644 --- a/dbus/dbus-userdb.c +++ b/dbus/dbus-userdb.c @@ -602,7 +602,7 @@ _dbus_user_database_flush (DBusUserDatabase *db) _dbus_hash_table_remove_all(db->groups); } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Increments refcount of user database. * @param db the database @@ -617,7 +617,7 @@ _dbus_user_database_ref (DBusUserDatabase *db) return db; } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ /** * Decrements refcount of user database. -- 1.7.9.5