Compare commits

..

11 Commits

Author SHA1 Message Date
e24d329c11 Branch at revision 46530
[SVN r46531]
2008-06-19 18:57:10 +00:00
9804292dad Move array test into canonical test subdir structure.
[SVN r44376]
2008-04-13 22:12:12 +00:00
069b5e2ca1 Throw out_of_range rather than range_error. See 21.1.1 paragraph 13.
[SVN r36304]
2006-12-08 16:54:30 +00:00
526953fc5e Test for out_of_range rather than range_error. See 21.1.1 paragraph 13.
[SVN r36303]
2006-12-08 16:53:49 +00:00
b06f12b0b7 Fixed license & copyright issues.
[SVN r36224]
2006-12-01 10:29:49 +00:00
f0bbb8b211 Add copyright, license
[SVN r35905]
2006-11-07 19:11:57 +00:00
d7a5408143 http://www.josuttis.com/ hasn't the latest version any more
[SVN r34855]
2006-08-08 18:49:30 +00:00
564e4029d0 Simplified code.
[SVN r34384]
2006-06-24 11:31:19 +00:00
0dc11c2f23 Fix compiler errors resulting from missing return values.
[SVN r34259]
2006-06-09 11:40:07 +00:00
7da1c4b310 Remove size zero support for old compilers that do not support partial template specialization
[SVN r34161]
2006-06-04 11:01:59 +00:00
8f10fdf27e Support for zero length arrays
[SVN r34154]
2006-06-03 12:51:13 +00:00
9 changed files with 18 additions and 4 deletions

View File

@ -157,7 +157,7 @@ namespace boost {
// check range (may be private because it is static) // check range (may be private because it is static)
static void rangecheck (size_type i) { static void rangecheck (size_type i) {
if (i >= size()) { if (i >= size()) {
throw std::range_error("array<>: index out of range"); throw std::out_of_range("array<>: index out of range");
} }
} }
@ -271,7 +271,7 @@ namespace boost {
// check range (may be private because it is static) // check range (may be private because it is static)
static reference failed_rangecheck () { static reference failed_rangecheck () {
std::range_error e("attempt to access element of an empty array"); std::out_of_range e("attempt to access element of an empty array");
boost::throw_exception(e); boost::throw_exception(e);
// //
// We need to return something here to keep // We need to return something here to keep

14
test/Jamfile.v2 Normal file
View File

@ -0,0 +1,14 @@
#~ Copyright Rene Rivera 2008
#~ Distributed under the Boost Software License, Version 1.0.
#~ (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import testing ;
test-suite array :
[ run array0.cpp ]
[ run array1.cpp ]
[ run array2.cpp ]
[ run array3.cpp ]
[ run array4.cpp ]
[ run array5.cpp ]
;

View File

@ -85,12 +85,12 @@ void RunTests()
// Confirm at() throws the std lib defined exception // Confirm at() throws the std lib defined exception
try { try {
BadValue( test_case.at( 0 ) ); BadValue( test_case.at( 0 ) );
} catch ( const std::range_error & ) { } catch ( const std::out_of_range & ) {
} }
try { try {
BadValue( const_test_case.at( 0 ) ); BadValue( const_test_case.at( 0 ) );
} catch ( const std::range_error & ) { } catch ( const std::out_of_range & ) {
} }
} }