Skip to content

Commit

Permalink
Fixed unit test warnings, bumped version to 3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dwvisser committed Oct 18, 2020
1 parent 227e540 commit 48e9afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.jam-daq</groupId>
<artifactId>Jam</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/test/data/HistogramTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import jam.data.*;
import jam.data.func.LinearFunction;
import junit.framework.Assert;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -76,7 +76,7 @@ public void testAddCounts() {
final double area1before = hist1.getArea();
Assert.assertEquals(
"Expected getArea() and getCount() to yield the same result.",
area1before, hist1.getCount());
area1before, hist1.getCount(), 0.001);
hist1.addCounts(hist1.getCounts());
assertAreaDoubled(hist1, area1before);
final double area2before = hist2.getArea();
Expand All @@ -101,7 +101,7 @@ private void assertAreaDoubled(final AbstractHistogram histogram,
final double area1before) {
final String should = "should be double before.";
Assert.assertEquals(histogram.getName() + should, histogram.getArea(),
2 * area1before);
2 * area1before, 0.001);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/test/sort/SortOfflineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class SortOfflineTest {

private static void assertHistogramZeroed(final AbstractHistogram histogram) {
assertEquals("Expected '" + histogram.getName() + "' to be zeroed.",
histogram.getArea(), 0.0);
histogram.getArea(), 0.0, 0.001);
}

private void sortEventFile(final String eventFileName, final int repitition) {
Expand Down Expand Up @@ -66,7 +66,7 @@ private void assertPostConditionsForYaleCAEN(final HistInt1D neutronE,
assertEquals("Events sorted wasn't the same as expected.",
expectedEvents, session.getEventsSorted());
assertEquals("Area in histogram wasn't the same as expected.",
(double) expectedEvents, neutronE.getArea());
(double) expectedEvents, neutronE.getArea(), 0.001);
}

private HistInt1D setupYaleCAENOfflineSort() {
Expand Down Expand Up @@ -102,7 +102,7 @@ public void testYaleOfflineSort() {
final HistInt1D cathode = setupYaleOfflineSort();
sortEventFile("sampledata/example.evn", 1);
assertEquals("Area in histogram wasn't the same as expected.",
789.0, cathode.getArea());
789.0, cathode.getArea(), 0.001);
} finally {
session.resetOfflineSorting();
}
Expand All @@ -127,7 +127,7 @@ public void testYaleOfflineSortTwoFiles() {
final HistInt1D cathode = setupYaleOfflineSort();
sortEventFile("sampledata/example.evn", 2);
assertEquals("Area in histogram wasn't the same as expected.",
2 * 789.0, cathode.getArea());
2 * 789.0, cathode.getArea(), 0.001);
} finally {
session.resetOfflineSorting();
}
Expand Down

0 comments on commit 48e9afc

Please sign in to comment.