diff --git a/amr-wind/core/vs/tensorI.H b/amr-wind/core/vs/tensorI.H index b8780720d0..75d95598c0 100644 --- a/amr-wind/core/vs/tensorI.H +++ b/amr-wind/core/vs/tensorI.H @@ -153,6 +153,7 @@ operator&&(const TensorT& t1, const TensorT& t2) template AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T mag_sqr(const TensorT& t) { + // cppcheck-suppress duplicateExpression return (t && t); } diff --git a/unit_tests/core/test_simtime.cpp b/unit_tests/core/test_simtime.cpp index 70c8d5e064..9f76bf1c2b 100644 --- a/unit_tests/core/test_simtime.cpp +++ b/unit_tests/core/test_simtime.cpp @@ -57,6 +57,7 @@ TEST_F(SimTimeTest, init) // Check that the timestep growth is not greater than 10% of the last // timestep time.set_current_cfl(cur_cfl * 0.5, 0.0, 0.0); + // cppcheck-suppress unreadVariable EXPECT_NEAR(time.deltaT(), 1.1 * first_dt, tol); } @@ -84,6 +85,7 @@ TEST_F(SimTimeTest, time_loop) EXPECT_EQ(regrid_counter, 1); EXPECT_TRUE(time.write_last_checkpoint()); + // cppcheck-suppress unreadVariable EXPECT_FALSE(time.write_last_plot_file()); } @@ -115,6 +117,7 @@ TEST_F(SimTimeTest, fixed_dt_loop) EXPECT_EQ(regrid_counter, 3); EXPECT_FALSE(time.write_last_checkpoint()); + // cppcheck-suppress unreadVariable EXPECT_FALSE(time.write_last_plot_file()); } diff --git a/unit_tests/core/vs/test_vspace.cpp b/unit_tests/core/vs/test_vspace.cpp index c347b8f835..54176f7603 100644 --- a/unit_tests/core/vs/test_vspace.cpp +++ b/unit_tests/core/vs/test_vspace.cpp @@ -156,6 +156,7 @@ TEST(VectorSpace, vector_create) EXPECT_NEAR(v1.x(), v6.x(), tol); EXPECT_NEAR(v1.y(), v6.y(), tol); + // cppcheck-suppress unreadVariable EXPECT_NEAR(v1.z(), v6.z(), tol); test_vector_create_impl(); @@ -178,7 +179,7 @@ TEST(VectorSpace, vector_ops) EXPECT_NEAR((v1 & v2), 50.0 * v21, tol); EXPECT_NEAR((v1 & vs::Vector::khat()), 0.0, tol); - + // cppcheck-suppress unreadVariable EXPECT_NEAR(vs::mag_sqr((v1 + v2) - vs::Vector{11.0, 22.0, 0.0}), 0.0, tol); }