Skip to content

Commit

Permalink
Fix the hydrogen test for the revised N valence model
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis committed Sep 9, 2023
1 parent 70b0636 commit 1878545
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/qtgui/hydrogentoolstest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 1878545

Please sign in to comment.