Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Double bond orders are not properly assigned when using the SilentCOB
Change-Id: I299374c6ad0bf75f1e97ace99de52cb813e5c221
Signed-off-by: ngn <jeliazkova.nina@gmail.com>
  • Loading branch information
egonw committed Apr 3, 2012
1 parent a6597e3 commit fb37eab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/META-INF/test-smiles.cdkdepends
Expand Up @@ -4,6 +4,7 @@ cdk-core.jar
cdk-standard.jar
cdk-data.jar
cdk-datadebug.jar
cdk-silent.jar
cdk-nonotify.jar
cdk-io.jar
cdk-ioformats.jar
Expand Down
20 changes: 20 additions & 0 deletions src/test/org/openscience/cdk/smiles/DeduceBondSystemToolTest.java
Expand Up @@ -36,6 +36,7 @@
import org.openscience.cdk.nonotify.NNBond;
import org.openscience.cdk.nonotify.NNMolecule;
import org.openscience.cdk.ringsearch.AllRingsFinder;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;

/**
Expand Down Expand Up @@ -75,6 +76,25 @@ public void testPyrrole() throws Exception {
molecule = dbst.fixAromaticBondOrders(molecule);
Assert.assertNotNull(molecule);

molecule = (IMolecule) AtomContainerManipulator.removeHydrogens(molecule);
int doubleBondCount = 0;
for (int i = 0; i < molecule.getBondCount(); i++) {
IBond bond = molecule.getBond(i);
Assert.assertTrue(bond.getFlag(CDKConstants.ISAROMATIC));
if (bond.getOrder() == Order.DOUBLE) doubleBondCount++;
}
Assert.assertEquals(6, doubleBondCount);
}

@Test(timeout=1000)
public void testPyrrole_Silent() throws Exception {
String smiles = "c2ccc3n([H])c1ccccc1c3(c2)";
SmilesParser smilesParser = new SmilesParser(SilentChemObjectBuilder.getInstance());
IMolecule molecule = smilesParser.parseSmiles(smiles);

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

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

0 comments on commit fb37eab

Please sign in to comment.