Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Adapt tests and build system to new exception system interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst committed Apr 9, 2016
1 parent 38eadb7 commit db13da3
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/linalgwrap/CMakeLists.txt
Expand Up @@ -25,6 +25,7 @@
set(LINALGWRAP_SOURCES
ParameterMap.cc
ExceptionBase.cc
ExceptionSystem.cc
version.cc
)

Expand Down
2 changes: 1 addition & 1 deletion tests/ArmadilloMatrixTests.cc
Expand Up @@ -35,7 +35,7 @@ using namespace rc;
#ifdef LINALGWRAP_HAVE_ARMADILLO
TEST_CASE("ArmadilloMatrix class", "[ArmadilloMatrix]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// The type of matrix we wish to test.
typedef ArmadilloMatrix<double> matrix_type;
Expand Down
2 changes: 1 addition & 1 deletion tests/ArmadilloVectorTests.cc
Expand Up @@ -29,7 +29,7 @@ using namespace rc;
#ifdef LINALGWRAP_HAVE_ARMADILLO
TEST_CASE("ArmadilloVector class", "[ArmadilloVector]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// The type of vector we wish to test.
typedef ArmadilloVector<double> vector_type;
Expand Down
2 changes: 1 addition & 1 deletion tests/BlockDiagonalMatrixTests.cc
Expand Up @@ -29,7 +29,7 @@ using namespace rc;

TEST_CASE("BlockDiagonalMatrix class", "[BlockDiagonalMatrix]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

typedef double scalar_type;
typedef SmallMatrix<scalar_type> stored_matrix_type;
Expand Down
2 changes: 1 addition & 1 deletion tests/BlockViewTests.cc
Expand Up @@ -27,7 +27,7 @@ using namespace rc;

TEST_CASE("BlockView", "[BlockView]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// Define the types we use for the test:
struct TestTypes {
Expand Down
7 changes: 3 additions & 4 deletions tests/ExceptionTests.cc
Expand Up @@ -27,8 +27,7 @@ using namespace rc;

TEST_CASE("Exception system", "[exception]") {
// Make sure that the program does not get aborted
linalgwrap::exceptions::assert_dbg_effect =
linalgwrap::exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

SECTION("Test throw or raise mechanism") {
#ifdef DEBUG
Expand All @@ -46,10 +45,10 @@ TEST_CASE("Exception system", "[exception]") {

// Test if an ExcNotImplemented exception would be thrown:
REQUIRE_THROWS_AS(assert_throw(false, ExcNotImplemented()),
exceptions::ExcNotImplemented);
ExcNotImplemented);

// Test if an ExcIO exception would be thrown:
REQUIRE_THROWS_AS(assert_throw(false, ExcIO()), exceptions::ExcIO);
REQUIRE_THROWS_AS(assert_throw(false, ExcIO()), ExcIO);
}

//
Expand Down
3 changes: 1 addition & 2 deletions tests/LazyMatrixProductTests.cc
Expand Up @@ -30,8 +30,7 @@ using namespace rc;

TEST_CASE("LazyMatrixProduct", "[LazyMatrixProduct]") {
// Make sure that the program does not get aborted
linalgwrap::exceptions::assert_dbg_effect =
linalgwrap::exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// TODO Test swap function
// TODO Test constructors
Expand Down
3 changes: 1 addition & 2 deletions tests/LazyMatrixSumTests.cc
Expand Up @@ -28,8 +28,7 @@ using namespace rc;

TEST_CASE("LazyMatrixSum", "[LazyMatrixSum]") {
// Make sure that the program does not get aborted
linalgwrap::exceptions::assert_dbg_effect =
linalgwrap::exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// TODO Test swap function
// TODO Test constructors
Expand Down
2 changes: 1 addition & 1 deletion tests/LazyMatrixWrapperTests.cc
Expand Up @@ -31,7 +31,7 @@ TEST_CASE("LazyMatrixWrapper class", "[LazyMatrixWrapper]") {
// Test swapping

// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

typedef double scalar_type;
typedef SmallMatrix<scalar_type> stored_matrix_type;
Expand Down
3 changes: 1 addition & 2 deletions tests/LazyMatrix_i_Tests.cc
Expand Up @@ -58,9 +58,8 @@ class SimpleLazyMatrix : public LazyMatrix_i<StoredMatrix> {

TEST_CASE("LazyMatrix_i abstract class", "[LazyMatrix_i]") {
using namespace lazymatrix_i_tests;

// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// Test constructor
// Test swapping
Expand Down
2 changes: 1 addition & 1 deletion tests/ParameterMapTests.cc
Expand Up @@ -29,7 +29,7 @@ using namespace rc;

TEST_CASE("ParameterMap tests", "[parametermap]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// Some data:
int i = 5;
Expand Down
2 changes: 1 addition & 1 deletion tests/RangeTests.cc
Expand Up @@ -141,7 +141,7 @@ TEST_CASE("Range tests", "[range]") {
using namespace range_tests;

// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

SECTION("Range construction") {
REQUIRE(rc::check("Range construction (size_t)",
Expand Down
2 changes: 1 addition & 1 deletion tests/ScaleViewTests.cc
Expand Up @@ -28,7 +28,7 @@ using namespace rc;

TEST_CASE("ScaleView", "[ScaleView]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// Define the types we use for the test:
struct TestTypes {
Expand Down
4 changes: 1 addition & 3 deletions tests/SubscriptionTests.cc
Expand Up @@ -998,10 +998,8 @@ struct AssignRemovePointer
TEST_CASE("Subscription and SubscriptionPointer system", "[subscription]") {
using namespace subscription_tests;

#ifdef DEBUG
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
#endif
AssertDbgEffect::set(ExceptionEffect::THROW);

SECTION("SubscriptionPointer gets the data from Subscribable") {
SimpleSubscribable s{};
Expand Down
2 changes: 1 addition & 1 deletion tests/TransposeViewTests.cc
Expand Up @@ -27,7 +27,7 @@ using namespace rc;

TEST_CASE("TransposeView", "[TransposeView]") {
// Make sure that the program does not get aborted
exceptions::assert_dbg_effect = exceptions::ExceptionEffect::THROW;
AssertDbgEffect::set(ExceptionEffect::THROW);

// Define the types we use for the test:
struct TestTypes {
Expand Down

0 comments on commit db13da3

Please sign in to comment.