diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-02-04 12:51:52 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-02-04 12:51:52 -0500 |
commit | af116081f9d30d0830dc3c099c9c87f37b07d1f0 (patch) | |
tree | c4385d5f2919c605a3d68f84630bd2c2f3ea4134 /src/common/util.h | |
parent | 5da517e6897c4b997bb165dfd11e95f8f9c2bbbe (diff) | |
download | tor-af116081f9d30d0830dc3c099c9c87f37b07d1f0.tar.gz tor-af116081f9d30d0830dc3c099c9c87f37b07d1f0.zip |
Make the no-assertions-during-coverage check into a configure option
Closes ticket 18242.
The rationale here is that I like having coverage on by default in my
own working directory, but I always want assertions turned on unless
I'm doing branch coverage specifically.
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/util.h b/src/common/util.h index 165bc0dcb3..d05ffa7d10 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -45,9 +45,10 @@ #error "Sorry; we don't support building with NDEBUG." #endif -/* Don't use assertions during coverage. It leads to tons of unreached - * branches which in reality are only assertions we didn't hit. */ -#ifdef TOR_COVERAGE +/* Sometimes we don't want to use assertions during branch coverage tests; it + * leads to tons of unreached branches which in reality are only assertions we + * didn't hit. */ +#if defined(TOR_UNIT_TESTS) && defined(DISABLE_ASSERTS_IN_UNIT_TESTS) #define tor_assert(a) STMT_BEGIN \ (void)(a); \ STMT_END |