1 //---------------------------------------------------------------------------// 2 // Copyright (c) 2013-2015 Kyle Lutz <kyle.r.lutz@gmail.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 TestNoDeviceFound 12 #include <boost/test/unit_test.hpp> 13 14 #include <boost/compute/exception/no_device_found.hpp> 15 throw_no_device_found()16void throw_no_device_found() 17 { 18 throw boost::compute::no_device_found(); 19 } 20 BOOST_AUTO_TEST_CASE(what)21BOOST_AUTO_TEST_CASE(what) 22 { 23 try { 24 throw_no_device_found(); 25 26 BOOST_REQUIRE(false); // should not get here 27 } 28 catch(boost::compute::no_device_found& e){ 29 BOOST_CHECK_EQUAL(std::string(e.what()), "No OpenCL device found"); 30 } 31 } 32