Skip to content

Commit

Permalink
check OutOfMemoryError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Aug 21, 2016
1 parent f674efd commit 62fa93d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_gsl_vector.cpp
Expand Up @@ -6,6 +6,8 @@
#include "gsl_vector.hpp"
#include "error.hpp"

#include <limits>

using namespace flexiblesusy;

BOOST_AUTO_TEST_CASE( test_init_default )
Expand Down Expand Up @@ -128,3 +130,10 @@ BOOST_AUTO_TEST_CASE( test_nonempty_bounds_check )
BOOST_CHECK_NO_THROW(v[2]);
BOOST_CHECK_THROW(v[3], OutOfBoundsError);
}

BOOST_AUTO_TEST_CASE( test_alloc )
{
gsl_set_error_handler_off();
BOOST_CHECK_THROW(GSL_vector v(std::numeric_limits<std::size_t>::max()),
OutOfMemoryError);
}

0 comments on commit 62fa93d

Please sign in to comment.