]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multi_array/test/assert.cpp
1 // Copyright 2007 The Trustees of Indiana University.
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // Boost.MultiArray Library
8 // Authors: Ronald Garcia
11 // See http://www.boost.org/libs/multi_array for documentation.
14 // Using the BOOST.ASSERT mechanism to replace library assertions
18 #include <boost/core/lightweight_test.hpp>
20 #define BOOST_ENABLE_ASSERT_HANDLER
21 #include <boost/multi_array.hpp> // includes assert.hpp
27 void assertion_failed(char const* expr
, char const* function
,
28 char const* file
, long line
) {
29 throw std::runtime_error(expr
);
32 void assertion_failed_msg(char const * expr
, char const * msg
,
33 char const * function
,
34 char const * file
, long line
) {
35 throw std::runtime_error(msg
);
40 using namespace boost
;
45 typedef multi_array
<int,2> array_t
;
47 array_t
A(extents
[2][2]);
49 array_t
B(extents
[3][3]);
53 BOOST_ERROR("did not throw an exception");
54 } catch (std::runtime_error
&) {
58 return boost::report_errors();