From 51c627df767cf22c5a3a25cb86096cbabb86cc13 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 23 Nov 2021 12:22:01 -0500 Subject: [PATCH] Add SCOPED_TRACE for better test error messages --- unittest/force-styles/test_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unittest/force-styles/test_main.cpp b/unittest/force-styles/test_main.cpp index 5f469f9f01..b4271975e4 100644 --- a/unittest/force-styles/test_main.cpp +++ b/unittest/force-styles/test_main.cpp @@ -38,6 +38,7 @@ using LAMMPS_NS::tagint; void EXPECT_STRESS(const std::string & name, double * stress, const stress_t & expected_stress, double epsilon) { + SCOPED_TRACE("EXPECT_STRESS: " + name); ErrorStats stats; EXPECT_FP_LE_WITH_EPS(stress[0], expected_stress.xx, epsilon); EXPECT_FP_LE_WITH_EPS(stress[1], expected_stress.yy, epsilon); @@ -49,6 +50,7 @@ void EXPECT_STRESS(const std::string & name, double * stress, const stress_t & e } void EXPECT_FORCES(const std::string & name, Atom * atom, const std::vector & f_ref, double epsilon) { + SCOPED_TRACE("EXPECT_FORCES: " + name); double ** f = atom->f; tagint * tag = atom->tag; const int nlocal = atom->nlocal; @@ -63,6 +65,7 @@ void EXPECT_FORCES(const std::string & name, Atom * atom, const std::vector & x_ref, double epsilon) { + SCOPED_TRACE("EXPECT_POSITIONS: " + name); double ** x = atom->x; tagint * tag = atom->tag; const int nlocal = atom->nlocal; @@ -77,6 +80,7 @@ void EXPECT_POSITIONS(const std::string & name, Atom * atom, const std::vector & v_ref, double epsilon) { + SCOPED_TRACE("EXPECT_VELOCITIES: " + name); double ** v = atom->v; tagint * tag = atom->tag; const int nlocal = atom->nlocal;