Navigation Menu

Skip to content

Commit

Permalink
[unit] Make sure that G_DISABLE_ASSERT is not defined
Browse files Browse the repository at this point in the history
For whatever reason, g_assert() is a special case and can be disabled
with G_DISABLE_ASSERT macro, unlike all other g_assert_* macros. And
if it's disabled, unit tests won't do what they are supposed to do.
  • Loading branch information
monich committed Aug 24, 2020
1 parent 31b0b5c commit afa7458
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions unit/common/test_common.h
Expand Up @@ -35,6 +35,15 @@

#include <nfc_types.h>

/*
* For whatever reason, g_assert() is a special case and can be disabled
* with G_DISABLE_ASSERT macro, unlike all other g_assert_* macros. Make
* sure that it actually works.
*/
#ifdef G_DISABLE_ASSERT
# error "g_assert is required by unit tests"
#endif

#define TEST_FLAG_DEBUG (0x01)
typedef struct test_opt {
int flags;
Expand Down

0 comments on commit afa7458

Please sign in to comment.