test_context_error.cpp 1.0 KB

12345678910111213141516171819202122232425
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2014 Fabian Köhler <fabian2804@googlemail.com>
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #define BOOST_TEST_MODULE TestContextError
  11. #include <boost/test/unit_test.hpp>
  12. #include <boost/compute/system.hpp>
  13. #include <boost/compute/exception/context_error.hpp>
  14. BOOST_AUTO_TEST_CASE(what)
  15. {
  16. boost::compute::context context = boost::compute::system::default_context();
  17. boost::compute::context_error error(&context, "Test", 0, 0);
  18. BOOST_CHECK_EQUAL(std::string(error.what()), std::string("Test"));
  19. BOOST_CHECK(*error.get_context_ptr() == context);
  20. BOOST_CHECK(error.get_private_info_ptr() == 0);
  21. BOOST_CHECK(error.get_private_info_size() == 0);
  22. }