Skip to content

Commit

Permalink
Modifications to required invariants for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Jul 22, 2016
1 parent 1600782 commit 2f2ccc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Expand Up @@ -360,7 +360,6 @@ IBond toCDKBond(Edge edge, IAtom[] atoms) {
if (atoms[u].isAromatic() && atoms[v].isAromatic()) {
bond.setIsAromatic(true);
bond.setOrder(IBond.Order.UNSET);
bond.setFlag(CDKConstants.SINGLE_OR_DOUBLE, true);
atoms[u].setIsAromatic(true);
atoms[v].setIsAromatic(true);
}
Expand Down
Expand Up @@ -75,6 +75,7 @@ public void testPyrrole() throws Exception {
SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
smilesParser.kekulise(false);
IAtomContainer molecule = smilesParser.parseSmiles(smiles);
AtomContainerManipulator.setSingleOrDoubleFlags(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

molecule = dbst.fixAromaticBondOrders(molecule);
Expand All @@ -96,12 +97,13 @@ public void testPyrrole_Silent() throws Exception {
SmilesParser smilesParser = new SmilesParser(SilentChemObjectBuilder.getInstance());
smilesParser.kekulise(false);
IAtomContainer molecule = smilesParser.parseSmiles(smiles);
AtomContainerManipulator.setSingleOrDoubleFlags(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

molecule = dbst.fixAromaticBondOrders(molecule);
Assert.assertNotNull(molecule);

molecule = (IAtomContainer) AtomContainerManipulator.removeHydrogens(molecule);

int doubleBondCount = 0;
for (int i = 0; i < molecule.getBondCount(); i++) {
IBond bond = molecule.getBond(i);
Expand Down Expand Up @@ -164,6 +166,7 @@ public void testPyrrole_CustomRingFinder() throws Exception {
SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
smilesParser.kekulise(false);
IAtomContainer molecule = smilesParser.parseSmiles(smiles);
AtomContainerManipulator.setSingleOrDoubleFlags(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

DeduceBondSystemTool dbst = new DeduceBondSystemTool(new AllRingsFinder());
Expand Down
Expand Up @@ -74,6 +74,7 @@ public void testPyrrole() throws Exception {
SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
smilesParser.kekulise(false);
IAtomContainer molecule = smilesParser.parseSmiles(smiles);
AtomContainerManipulator.setSingleOrDoubleFlags(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

molecule = fbot.kekuliseAromaticRings(molecule);
Expand All @@ -95,11 +96,11 @@ public void testPyrrole_Silent() throws Exception {
SmilesParser smilesParser = new SmilesParser(SilentChemObjectBuilder.getInstance());
smilesParser.kekulise(false);
IAtomContainer molecule = smilesParser.parseSmiles(smiles);
AtomContainerManipulator.setSingleOrDoubleFlags(molecule);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);

molecule = fbot.kekuliseAromaticRings(molecule);
Assert.assertNotNull(molecule);

molecule = (IAtomContainer) AtomContainerManipulator.removeHydrogens(molecule);
int doubleBondCount = 0;
for (int i = 0; i < molecule.getBondCount(); i++) {
Expand Down

0 comments on commit 2f2ccc4

Please sign in to comment.