Skip to content

Commit

Permalink
Updated OB note and robustified unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
rajarshi authored and egonw committed Aug 1, 2010
1 parent dbd6df4 commit 2b96512
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/org/openscience/cdk/io/Mol2Reader.java
Expand Up @@ -295,6 +295,8 @@ private IMolecule readMolecule(IMolecule molecule) throws CDKException {
String atomTypeStr = tokenizer.nextToken();

// fix OpenBabel atom type codes to SYBYL specification
// this addresses wrong types that were output by OB (but is now fixed)
// see https://sourceforge.net/tracker/index.php?func=detail&aid=1650239&group_id=40728&atid=428740
if ("S.o2".equals(atomTypeStr)) atomTypeStr = "S.O2";
if ("S.o".equals(atomTypeStr)) atomTypeStr = "S.O";

Expand Down
5 changes: 4 additions & 1 deletion src/test/org/openscience/cdk/io/Mol2ReaderTest.java
Expand Up @@ -125,7 +125,7 @@ public class Mol2ReaderTest extends SimpleChemObjectReaderTest {
*
* @throws Exception if an error occurs
*/
public void testNCIfeb03_2D() throws Exception {
@Test public void testNCIfeb03_2D() throws Exception {
Assume.assumeTrue(runSlowTests());

String filename = "data/mol2/NCI_feb03_2D.mol2.gz";
Expand Down Expand Up @@ -155,6 +155,8 @@ public void testMultiMol() throws Exception {
IChemFile chemFile = reader.read(new ChemFile());
List<IAtomContainer> mols = ChemFileManipulator.getAllAtomContainers(chemFile);
Assert.assertEquals(30, mols.size());
Assert.assertEquals(25, mols.get(0).getAtomCount());
Assert.assertEquals(24, mols.get(29).getAtomCount());
}

@Test
Expand All @@ -167,6 +169,7 @@ public void testMultiMolButSingle() throws Exception {
IChemFile chemFile = reader.read(new ChemFile());
List<IAtomContainer> mols = ChemFileManipulator.getAllAtomContainers(chemFile);
Assert.assertEquals(1, mols.size());
Assert.assertEquals(12, mols.get(0).getAtomCount());

}

Expand Down

0 comments on commit 2b96512

Please sign in to comment.