Skip to content

Commit

Permalink
Added a test case for GeometryTools.has2DCoordinatesNew where a mol f…
Browse files Browse the repository at this point in the history
…ile has a single atom with 0,0,0 as coordinate. This is not considered a 2d coordinate right now, but in a way it is one.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
Stefan Kuhn authored and egonw committed Feb 25, 2010
1 parent 0064458 commit f5e123e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/data/mdl/with000coordinate.mol
@@ -0,0 +1,6 @@

CDK 1/12/10,12:20

1 0 0 0 0 0 0 0 0 0999 V2000
0.0000 0.0000 0.0000 N 0 0 0 0 0 3 0 0 0 0 0 0
M END
10 changes: 10 additions & 0 deletions src/test/org/openscience/cdk/geometry/GeometryToolsTest.java
Expand Up @@ -36,6 +36,7 @@
import org.openscience.cdk.Molecule;
import org.openscience.cdk.Reaction;
import org.openscience.cdk.config.Elements;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
Expand Down Expand Up @@ -89,6 +90,15 @@ public class GeometryToolsTest extends CDKTestCase {
Assert.assertFalse(GeometryTools.has2DCoordinates((IAtomContainer)null));
}

@Test public void testHas2DCoordinates_With000() throws CDKException {
String filenameMol = "data/mdl/with000coordinate.mol";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filenameMol);
Molecule molOne=null;
MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
molOne = (Molecule)reader.read(new Molecule());
Assert.assertEquals(2,GeometryTools.has2DCoordinatesNew(molOne));
}

@Test public void testTranslateAllPositive_IAtomContainer() {
IAtomContainer container = new NNAtomContainer();
IAtom atom = new NNAtom(Elements.CARBON);
Expand Down

0 comments on commit f5e123e

Please sign in to comment.