Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Two more tests, reflecting the assumptions that the Number is differe…

…nt for different flags, and the same when the same flag is set

Change-Id: I31ba2dafc89524d95708cd87e499fd7bbeb9cffa
Signed-off-by: John May <john.wilkinsonmay@gmail.com>
  • Loading branch information...
commit ed7a3fc21764108763e29725f06523670ff37097 1 parent 96032d8
@egonw egonw authored
View
22 src/test/org/openscience/cdk/interfaces/AbstractChemObjectTest.java
@@ -122,6 +122,28 @@
Assert.assertNotSame((short)0, chemObject.getFlagValue());
}
+ /**
+ * Different flags are reflected by different numbers.
+ */
+ @Test public void testGetFlagValueDifferentFlags(){
+ IChemObject chemObject = newChemObject();
+ chemObject.setFlag(CDKConstants.ISALIPHATIC, true);
+ IChemObject chemObject2 = newChemObject();
+ chemObject2.setFlag(CDKConstants.VISITED, true);
+ Assert.assertNotSame(chemObject.getFlagValue(), chemObject2.getFlagValue());
+ }
+
+ /**
+ * The number is always the same for the same flag.
+ */
+ @Test public void testGetFlagValueSameFlag(){
+ IChemObject chemObject = newChemObject();
+ chemObject.setFlag(CDKConstants.ISPLACED, true);
+ IChemObject chemObject2 = newChemObject();
+ chemObject2.setFlag(CDKConstants.ISPLACED, true);
+ Assert.assertEquals(chemObject.getFlagValue(), chemObject2.getFlagValue());
+ }
+
@Test public void testGetFlags_Array(){
IChemObject chemObject=newChemObject();
chemObject.setFlag(CDKConstants.ISINRING, true);
Please sign in to comment.
Something went wrong with that request. Please try again.