diff --git a/scripts/run-valgrind-cpp.sh b/scripts/run-valgrind-cpp.sh index fd08cbda54..a96b1d90e6 100755 --- a/scripts/run-valgrind-cpp.sh +++ b/scripts/run-valgrind-cpp.sh @@ -10,4 +10,4 @@ set -eou pipefail # run tests cd "${AMICI_PATH}/build/" VALGRIND_OPTS="--leak-check=full --error-exitcode=1 --trace-children=yes --show-leak-kinds=definite" -valgrind ${VALGRIND_OPTS} ctest +CTEST_OUTPUT_ON_FAILURE=1 valgrind ${VALGRIND_OPTS} ctest diff --git a/tests/cpp/unittests/testMisc.cpp b/tests/cpp/unittests/testMisc.cpp index b06880072f..0cc7a017dc 100644 --- a/tests/cpp/unittests/testMisc.cpp +++ b/tests/cpp/unittests/testMisc.cpp @@ -360,10 +360,9 @@ TEST_F(SolverTest, SettersGettersWithSetup) ASSERT_EQ(static_cast(solver.getSensitivityMethod()), static_cast(sensi_meth)); - sundials::Context sunctx; auto rdata = std::make_unique(solver, testModel); - AmiVector x(nx, sunctx), dx(nx, sunctx); - AmiVectorArray sx(nx, 1, sunctx), sdx(nx, 1, sunctx); + AmiVector x(nx, solver.getSunContext()), dx(nx, solver.getSunContext()); + AmiVectorArray sx(nx, 1, solver.getSunContext()), sdx(nx, 1, solver.getSunContext()); testModel.setInitialStates(std::vector{ 0 });