Skip to content

Commit

Permalink
added a test for bug #2831420
Browse files Browse the repository at this point in the history
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
Stefan Kuhn authored and egonw committed Sep 11, 2009
1 parent 242da91 commit 93536f0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/test/data/mdl/bug2831420.mol
@@ -0,0 +1,34 @@

CDK 8/3/09,11:10

13 14 0 0 0 0 0 0 0 0999 V2000
2.3735 2.5567 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.7634 3.9271 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
3.8652 2.3999 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.6450 5.1406 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.7469 3.6135 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.1475 6.5109 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
4.1368 4.9838 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.7231 7.9781 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.5853 5.5727 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.2313 8.1349 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4133 6.7646 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.5187 9.4339 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
3.6013 6.9845 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2 1 2 0 0 0 0
3 1 1 0 0 0 0
4 2 1 0 0 0 0
5 3 2 0 0 0 0
6 4 1 0 0 0 0
4 7 2 0 0 0 0
7 5 1 0 0 0 0
8 6 1 0 0 0 0
9 6 1 0 0 0 0
10 8 1 0 0 0 0
11 9 1 0 0 0 0
12 10 2 0 0 0 0
11 10 1 0 0 0 0
6 13 1 1 0 0 0
M END


12 changes: 12 additions & 0 deletions src/test/org/openscience/cdk/geometry/BondToolsTest.java
Expand Up @@ -212,6 +212,18 @@ public void testIsValidDoubleBondConfiguration_IAtomContainer_IBond() throws Exc
IMolecule mol=chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getMolecule(0);
Assert.assertEquals(2.0943946986086157,BondTools.giveAngleFromMiddle(mol.getAtom(0),mol.getAtom(2),mol.getAtom(3)),0.2);
}

/**
* @cdk.bug 2831420
*/
@Test public void testBug2831420() throws Exception {
String filename = "data/mdl/bug2831420.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
MDLV2000Reader reader = new MDLV2000Reader(ins);
ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
IMolecule mol=chemFile.getChemSequence(0).getChemModel(0).getMoleculeSet().getMolecule(0);
Assert.assertTrue(BondTools.isStereo(mol, mol.getAtom(5)));
}
}


0 comments on commit 93536f0

Please sign in to comment.