Skip to content

Commit

Permalink
annotations to satisfy coverage unit test
Browse files Browse the repository at this point in the history
Change-Id: Ie997672ba460e8a18af8612cc595272ef040a3e1
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Mar 24, 2013
1 parent 48861ee commit e867e4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/org/openscience/cdk/inchi/InChIGeneratorFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
* @author Sam Adams
*
* @cdk.module inchi
* @cdk.githash
* @cdk.githash
*/
@TestClass("org.openscience.cdk.inchi.InChIGeneratorFactoryTest")
public class InChIGeneratorFactory {
Expand Down Expand Up @@ -120,8 +120,8 @@ public static InChIGeneratorFactory getInstance() throws CDKException {
*
* @param ignore if aromatic bonds should be treated as bonds of type single and double
*/
@TestMethod("testInChIGenerator_AromaticBonds")
public void setIgnoreAromaticBonds(boolean ignore) {

ignoreAromaticBonds = ignore;
}

Expand All @@ -130,8 +130,8 @@ public void setIgnoreAromaticBonds(boolean ignore) {
*
* @return if aromatic bonds are treated as bonds of type single and double
*/
@TestMethod("testInChIGenerator_AromaticBonds")
public boolean getIgnoreAromaticBonds() {

return ignoreAromaticBonds;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
import org.openscience.cdk.templates.MoleculeFactory;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

/**
* @cdk.module test-inchi
*/
Expand Down Expand Up @@ -180,11 +184,14 @@ public void testGetInChIToStructure_String_IChemObjectBuilder_NullList() throws
InChIGenerator genAromaticity1 = inchiFactory.getInChIGenerator(tetrazole);

// exclude aromatic bonds
assertFalse(inchiFactory.getIgnoreAromaticBonds());
inchiFactory.setIgnoreAromaticBonds(true);
assertTrue(inchiFactory.getIgnoreAromaticBonds());
InChIGenerator genNoAromaticity = inchiFactory.getInChIGenerator(tetrazole);

// include aromatic bonds again
inchiFactory.setIgnoreAromaticBonds(false);
assertFalse(inchiFactory.getIgnoreAromaticBonds());
InChIGenerator genAromaticity2 = inchiFactory.getInChIGenerator(tetrazole);

// with the aromatic bonds included, no InChI can be generated
Expand Down

0 comments on commit e867e4b

Please sign in to comment.