Skip to content

Commit

Permalink
Exact mass and natural abundance is not preserved on reading/writing …
Browse files Browse the repository at this point in the history
…CML. As these attributes are boxed primitives they can be null and throw an exception when unboxed by 'assertEquals'. Before checking the values the attributes are not checked for nullity.

Change-Id: If6b52cf6f22d23405b8f15045d8ca1dccf0bcd74
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay committed Aug 5, 2013
1 parent c29a6b4 commit a92d226
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/org/openscience/cdk/io/cml/CMLRoundTripTest.java
Expand Up @@ -304,6 +304,8 @@ public void testAtomStereoParity() throws Exception {

Assert.assertEquals(1, roundTrippedMol.getAtomCount());
IAtom roundTrippedAtom = roundTrippedMol.getAtom(0);
Assert.assertNotNull(atom.getExactMass());
Assert.assertNotNull(roundTrippedAtom.getExactMass());
Assert.assertEquals(atom.getExactMass(), roundTrippedAtom.getExactMass(), 0.01);
}

Expand All @@ -319,6 +321,8 @@ public void testAtomStereoParity() throws Exception {

Assert.assertEquals(1, roundTrippedMol.getAtomCount());
IAtom roundTrippedAtom = roundTrippedMol.getAtom(0);
Assert.assertNotNull(atom.getNaturalAbundance());
Assert.assertNotNull(roundTrippedAtom.getNaturalAbundance());
Assert.assertEquals(atom.getNaturalAbundance(), roundTrippedAtom.getNaturalAbundance(), 0.01);
}

Expand Down

0 comments on commit a92d226

Please sign in to comment.