minitest.hpp 565 B

12345678910111213141516171819202122232425
  1. #ifndef BOOST_PROGRAM_OPTIONS_MINITEST
  2. #define BOOST_PROGRAM_OPTIONS_MINITEST
  3. #include <assert.h>
  4. #include <iostream>
  5. #include <stdlib.h>
  6. #define BOOST_REQUIRE(b) assert(b)
  7. #define BOOST_CHECK(b) assert(b)
  8. #define BOOST_CHECK_EQUAL(a, b) assert(a == b)
  9. #define BOOST_ERROR(description) std::cerr << description; std::cerr << "\n"; abort();
  10. #define BOOST_CHECK_THROW(expression, exception) \
  11. try \
  12. { \
  13. expression; \
  14. BOOST_ERROR("expected exception not thrown");\
  15. throw 10; \
  16. } \
  17. catch(exception &) \
  18. { \
  19. }
  20. #endif