Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Additional testing, based on bond order information, now possible

Change-Id: I5585560edab76b3e96434698c786ef9919be18a7
  • Loading branch information...
commit 28bcb6ea1f0ac756e4248eefb6f7fe114f78e6c1 1 parent 0208a93
Egon Willighagen authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/test/org/openscience/cdk/atomtype/AbstractAtomTypeTest.java
11 src/test/org/openscience/cdk/atomtype/AbstractAtomTypeTest.java
View
@@ -36,7 +36,9 @@
import org.openscience.cdk.interfaces.IAtomType;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
+import org.openscience.cdk.interfaces.IBond.Order;
import org.openscience.cdk.tools.manipulator.AtomTypeManipulator;
+import org.openscience.cdk.tools.manipulator.BondManipulator;
/**
* Helper class that all atom type matcher test classes must implement.
@@ -144,6 +146,15 @@ private void assertConsistentProperties(IAtomContainer mol, IAtom atom, IAtomTyp
connectionCount > matched.getFormalNeighbourCount()
);
}
+ if (matched.getMaxBondOrder() != null) {
+ Order expectedMax = matched.getMaxBondOrder();
+ Order maxBondOrder = BondManipulator.getMaximumBondOrder(connections);
+ Assert.assertTrue(
+ "The highest bond order exceeds the maximum for the atom type",
+ BondManipulator.isHigherOrder(expectedMax, maxBondOrder) |
+ expectedMax == maxBondOrder
+ );
+ }
}
public void assertAtomType(Map<String, Integer> testedAtomTypes, String expectedID, IAtomType foundAtomType) {
Please sign in to comment.
Something went wrong with that request. Please try again.