Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dangling pointer in SolverTest.SettersGettersWithSetup #2556

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- master
- update_valgrind_supp
- fix_valgrind_tests
pull_request:
branches:
- master
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-valgrind-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions tests/cpp/unittests/testMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,9 @@ TEST_F(SolverTest, SettersGettersWithSetup)
ASSERT_EQ(static_cast<int>(solver.getSensitivityMethod()),
static_cast<int>(sensi_meth));

sundials::Context sunctx;
auto rdata = std::make_unique<ReturnData>(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<realtype>{ 0 });

Expand Down
Loading