From 18785457e7efc9a07c15df4cd475df190a2134e6 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Sat, 9 Sep 2023 17:24:05 -0400 Subject: [PATCH] Fix the hydrogen test for the revised N valence model Signed-off-by: Geoff Hutchison --- tests/qtgui/hydrogentoolstest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qtgui/hydrogentoolstest.cpp b/tests/qtgui/hydrogentoolstest.cpp index 776ca12af4..10fdd9c276 100644 --- a/tests/qtgui/hydrogentoolstest.cpp +++ b/tests/qtgui/hydrogentoolstest.cpp @@ -173,9 +173,10 @@ TEST(HydrogenToolsTest, valencyAdjustment_N) RWAtom N = mol.addAtom(7); int expectedAdjustment = 3; for (int i = 0; i < 8; ++i, --expectedAdjustment) { - if (i == 4) // neutral N can have 3 or 5 bonds in our valence model. - expectedAdjustment += 2; - EXPECT_EQ(expectedAdjustment, HydrogenTools::valencyAdjustment(N)); + if (i == 5) // neutral N can have 3 or 5 bonds in our valence model. + EXPECT_EQ(0, HydrogenTools::valencyAdjustment(N)); + else + EXPECT_EQ(expectedAdjustment, HydrogenTools::valencyAdjustment(N)); mol.addBond(mol.addAtom(1), N, 1); } }