diff options
Diffstat (limited to 'dbus/dbus-internals.c')
-rw-r--r-- | dbus/dbus-internals.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index acd6d72f..5153a767 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -291,56 +291,4 @@ _dbus_type_to_string (int type) } } -#ifdef DBUS_BUILD_TESTS -static int fail_alloc_counter = _DBUS_INT_MAX; -/** - * Sets the number of allocations until we simulate a failed - * allocation. If set to 0, the next allocation to run - * fails; if set to 1, one succeeds then the next fails; etc. - * Set to _DBUS_INT_MAX to not fail anything. - * - * @param until_next_fail number of successful allocs before one fails - */ -void -_dbus_set_fail_alloc_counter (int until_next_fail) -{ - fail_alloc_counter = until_next_fail; -} - -/** - * Gets the number of successful allocs until we'll simulate - * a failed alloc. - * - * @returns current counter value - */ -int -_dbus_get_fail_alloc_counter (void) -{ - return fail_alloc_counter; -} - -/** - * Called when about to alloc some memory; if - * it returns #TRUE, then the allocation should - * fail. If it returns #FALSE, then the allocation - * should not fail. - * - * @returns #TRUE if this alloc should fail - */ -dbus_bool_t -_dbus_decrement_fail_alloc_counter (void) -{ - if (fail_alloc_counter <= 0) - { - fail_alloc_counter = _DBUS_INT_MAX; - return TRUE; - } - else - { - fail_alloc_counter -= 1; - return FALSE; - } -} -#endif /* DBUS_BUILD_TESTS */ - /** @} */ |