Use lightweight tests to avoid Boost.Test warnings, RTTI issues and minimize compilation times

This commit is contained in:
Antony Polukhin
2015-06-21 23:16:46 +03:00
parent c0f75c27fa
commit d7ec25e56b
12 changed files with 175 additions and 183 deletions

View File

@ -14,13 +14,14 @@
#include <boost/unordered_set.hpp>
#include <boost/functional/hash.hpp>
//<-
// Making `#include <cassert>` visible in docs, while actually using hand-made check
// Making `#include <cassert>` visible in docs, while actually using `BOOST_TEST`
// instead of `assert`. This is required to verify correct behavior even if NDEBUG
// is defined and to avoid `unused local variable` warnings with defined NDEBUG.
#include <boost/core/lightweight_test.hpp>
#ifdef assert
# undef assert
#endif
#define assert(X) if (!(X)) std::exit(__LINE__)
#define assert(X) BOOST_TEST(X)
/* !Comment block is not closed intentionaly!
//->
#include <cassert>

View File

@ -18,17 +18,14 @@
#include <boost/type_index.hpp>
//] [/type_index_my_type_index_worldwide_macro]
using namespace my_namespace;
//<-
// Using hand-made check
// instead of `assert`. This is required to verify correct behavior even if NDEBUG
// is defined and to avoid `unused local variable` warnings with defined NDEBUG.
#include <boost/core/lightweight_test.hpp>
#ifdef assert
# undef assert
#endif
#define assert(X) if (!(X)) std::exit(__LINE__)
#define assert(X) BOOST_TEST(X)
using namespace my_namespace;
int main() {
//[type_index_my_type_index_usage