mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-06 06:00:14 +01:00
2003-04-05 Havoc Pennington <hp@pobox.com>
* doc/config-file.txt (Elements): fix docs of <auth> to reflect reality; in fact multiple mechanisms are allowed. * dbus/dbus-internals.c (_dbus_real_assert) (_dbus_real_assert_not_reached): move guts of _dbus_assert() and _dbus_assert_not_reached() into functions, so that they don't show up in basic block counts for test coverage, and don't use up as much disk space. Does mean slower execution speed though, so assumes --disable-asserts is the normal production case.
This commit is contained in:
parent
6164a2e5f4
commit
2f3fbd451d
4 changed files with 69 additions and 14 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2003-04-05 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* doc/config-file.txt (Elements): fix docs of <auth> to reflect
|
||||
reality; in fact multiple mechanisms are allowed.
|
||||
|
||||
* dbus/dbus-internals.c (_dbus_real_assert)
|
||||
(_dbus_real_assert_not_reached): move guts of _dbus_assert() and
|
||||
_dbus_assert_not_reached() into functions, so that they don't show
|
||||
up in basic block counts for test coverage, and don't use up as
|
||||
much disk space. Does mean slower execution speed though, so
|
||||
assumes --disable-asserts is the normal production case.
|
||||
|
||||
2003-04-05 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* test/Makefile.am (dist-hook): also dist *.in files
|
||||
|
|
|
|||
|
|
@ -345,6 +345,53 @@ _dbus_type_to_string (int type)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef DBUS_DISABLE_ASSERT
|
||||
/**
|
||||
* Internals of _dbus_assert(); it's a function
|
||||
* rather than a macro with the inline code so
|
||||
* that the assertion failure blocks don't show up
|
||||
* in test suite coverage, and to shrink code size.
|
||||
*
|
||||
* @param condition TRUE if assertion succeeded
|
||||
* @param condition_text condition as a string
|
||||
* @param file file the assertion is in
|
||||
* @param line line the assertion is in
|
||||
*/
|
||||
void
|
||||
_dbus_real_assert (dbus_bool_t condition,
|
||||
const char *condition_text,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
if (!condition)
|
||||
{
|
||||
_dbus_warn ("Assertion failed \"%s\" file \"%s\" line %d\n",
|
||||
condition_text, file, line);
|
||||
_dbus_abort ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Internals of _dbus_assert_not_reached(); it's a function
|
||||
* rather than a macro with the inline code so
|
||||
* that the assertion failure blocks don't show up
|
||||
* in test suite coverage, and to shrink code size.
|
||||
*
|
||||
* @param explanation what was reached that shouldn't have been
|
||||
* @param file file the assertion is in
|
||||
* @param line line the assertion is in
|
||||
*/
|
||||
void
|
||||
_dbus_real_assert_not_reached (const char *explanation,
|
||||
const char *file,
|
||||
int line)
|
||||
{
|
||||
_dbus_warn ("File \"%s\" line %d should not have been reached: %s\n",
|
||||
file, line, explanation);
|
||||
_dbus_abort ();
|
||||
}
|
||||
#endif /* DBUS_DISABLE_ASSERT */
|
||||
|
||||
#ifdef DBUS_BUILD_TESTS
|
||||
static dbus_bool_t
|
||||
run_failing_each_malloc (int n_mallocs,
|
||||
|
|
|
|||
|
|
@ -76,26 +76,22 @@ const char* _dbus_strerror (int error_number);
|
|||
#ifdef DBUS_DISABLE_ASSERT
|
||||
#define _dbus_assert(condition)
|
||||
#else
|
||||
void _dbus_real_assert (dbus_bool_t condition,
|
||||
const char *condition_text,
|
||||
const char *file,
|
||||
int line);
|
||||
#define _dbus_assert(condition) \
|
||||
do { \
|
||||
if (!(condition)) \
|
||||
{ \
|
||||
_dbus_warn ("Assertion failed \"%s\" file \"%s\" line %d\n", \
|
||||
#condition, __FILE__, __LINE__); \
|
||||
_dbus_abort (); \
|
||||
} \
|
||||
} while (0)
|
||||
_dbus_real_assert ((condition), #condition, __FILE__, __LINE__)
|
||||
#endif /* !DBUS_DISABLE_ASSERT */
|
||||
|
||||
#ifdef DBUS_DISABLE_ASSERT
|
||||
#define _dbus_assert_not_reached(explanation)
|
||||
#else
|
||||
void _dbus_real_assert_not_reached (const char *explanation,
|
||||
const char *file,
|
||||
int line);
|
||||
#define _dbus_assert_not_reached(explanation) \
|
||||
do { \
|
||||
_dbus_warn ("File \"%s\" line %d should not have been reached: %s\n", \
|
||||
__FILE__, __LINE__, (explanation)); \
|
||||
_dbus_abort (); \
|
||||
} while (0)
|
||||
_dbus_real_assert_not_reached (explanation, __FILE__, __LINE__)
|
||||
#endif /* !DBUS_DISABLE_ASSERT */
|
||||
|
||||
#define _DBUS_N_ELEMENTS(array) ((int) (sizeof ((array)) / sizeof ((array)[0])))
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ Elements:
|
|||
|
||||
Lists permitted authorization mechanisms. If this element doesn't
|
||||
exist, then all known mechanisms are allowed. If there are
|
||||
multiple <auth> elements, the last one wins (they are not merged).
|
||||
multiple <auth> elements, all the listed mechanisms are allowed.
|
||||
The order in which mechanisms are listed is not meaningful.
|
||||
|
||||
Example: <auth>EXTERNAL</auth>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue