|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73804 - sandbox/SOC/2011/checks/libs/checks/test
From: pierre.talbot.6114_at_[hidden]
Date: 2011-08-15 16:55:23
Author: trademark
Date: 2011-08-15 16:55:22 EDT (Mon, 15 Aug 2011)
New Revision: 73804
URL: http://svn.boost.org/trac/boost/changeset/73804
Log:
Use BOOST_CHECK_THROW instead of a try{} catch{}.
Text files modified:
sandbox/SOC/2011/checks/libs/checks/test/test_checks_tools.cpp | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)
Modified: sandbox/SOC/2011/checks/libs/checks/test/test_checks_tools.cpp
==============================================================================
--- sandbox/SOC/2011/checks/libs/checks/test/test_checks_tools.cpp (original)
+++ sandbox/SOC/2011/checks/libs/checks/test/test_checks_tools.cpp 2011-08-15 16:55:22 EDT (Mon, 15 Aug 2011)
@@ -66,30 +66,15 @@
typedef boost::checks::strict_size_contract<5> size_expected ;
typedef boost::checks::no_null_size_contract<> no_size_expected ;
- try{
- size_expected::respect_size_contract( 5 ) ;
- }catch( std::invalid_argument ){
- BOOST_FAIL("Launch an unexpected exception");
- }
+ size_expected::respect_size_contract( 5 ) ;
for(int i = 6 ; i < 14 ; ++i)
- try{
- size_expected::respect_size_contract( i%10+1 ) ;
- BOOST_FAIL("Should not be a correct size");
- }catch( std::invalid_argument ){}
-
+ BOOST_CHECK_THROW ( size_expected::respect_size_contract( i%10+1 ) , std::invalid_argument )
for(int i=1 ; i < 10; ++i)
- try{
- no_size_expected::respect_size_contract (i) ;
- }catch( std::invalid_argument ){
- BOOST_FAIL("Should be a correct size" ) ;
- }
+ no_size_expected::respect_size_contract (i) ;
- try{
- no_size_expected::respect_size_contract (0);
- BOOST_FAIL("The size can't be of size zero");
- }catch( std::invalid_argument ){}
+ BOOST_CHECK_THROW ( no_size_expected::respect_size_contract (0), std::invalid_argument )
for(int i = 0 ; i < 6 ; ++i)
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk