axiom.hpp 762 B

1234567891011121314151617181920212223
  1. // no #include guard
  2. // Copyright (C) 2008-2018 Lorenzo Caminiti
  3. // Distributed under the Boost Software License, Version 1.0 (see accompanying
  4. // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
  5. // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
  6. #include <boost/contract/check.hpp>
  7. bool no_impl(); // Test func that cannot be impl in C++ sill OK in axioms.
  8. int main() {
  9. #ifdef BOOST_CONTRACT_TEST_ERROR
  10. BOOST_CONTRACT_CHECK_AXIOM(
  11. BOOST_CONTRACT_TEST_ERROR_expected_undeclared_identifier);
  12. #else
  13. BOOST_CONTRACT_CHECK_AXIOM(false); // Test always false, OK.
  14. BOOST_CONTRACT_CHECK_AXIOM(no_impl()); // Test no implementation, OK.
  15. #endif
  16. return 0;
  17. }