Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Egon Willighagen authored October 01, 2012
22  src/test/org/openscience/cdk/interfaces/AbstractChemObjectTest.java
@@ -122,6 +122,28 @@
122 122
         Assert.assertNotSame((short)0, chemObject.getFlagValue());
123 123
     }
124 124
 
  125
+    /**
  126
+     * Different flags are reflected by different numbers.
  127
+     */
  128
+    @Test public void testGetFlagValueDifferentFlags(){
  129
+        IChemObject chemObject = newChemObject();
  130
+        chemObject.setFlag(CDKConstants.ISALIPHATIC, true);
  131
+        IChemObject chemObject2 = newChemObject();
  132
+        chemObject2.setFlag(CDKConstants.VISITED, true);
  133
+        Assert.assertNotSame(chemObject.getFlagValue(), chemObject2.getFlagValue());
  134
+    }
  135
+
  136
+    /**
  137
+     * The number is always the same for the same flag.
  138
+     */
  139
+    @Test public void testGetFlagValueSameFlag(){
  140
+        IChemObject chemObject = newChemObject();
  141
+        chemObject.setFlag(CDKConstants.ISPLACED, true);
  142
+        IChemObject chemObject2 = newChemObject();
  143
+        chemObject2.setFlag(CDKConstants.ISPLACED, true);
  144
+        Assert.assertEquals(chemObject.getFlagValue(), chemObject2.getFlagValue());
  145
+    }
  146
+
125 147
     @Test public void testGetFlags_Array(){
126 148
         IChemObject chemObject=newChemObject();
127 149
         chemObject.setFlag(CDKConstants.ISINRING, true);

0 notes on commit ed7a3fc

Please sign in to comment.
Something went wrong with that request. Please try again.