• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #define BOOST_TEST_MODULE TestContextError
12 #include <boost/test/unit_test.hpp>
13 
14 #include <boost/compute/system.hpp>
15 #include <boost/compute/exception/context_error.hpp>
16 
BOOST_AUTO_TEST_CASE(what)17 BOOST_AUTO_TEST_CASE(what)
18 {
19     boost::compute::context context = boost::compute::system::default_context();
20     boost::compute::context_error error(&context, "Test", 0, 0);
21     BOOST_CHECK_EQUAL(std::string(error.what()), std::string("Test"));
22     BOOST_CHECK(*error.get_context_ptr() == context);
23     BOOST_CHECK(error.get_private_info_ptr() == 0);
24     BOOST_CHECK(error.get_private_info_size() == 0);
25 }
26