01: package experiments;
02:
03: import junit.framework.Test;
04: import junit.framework.TestCase;
05: import junit.framework.TestSuite;
06:
07: /**
08: * Test for com.reeltwo.jumble testing.
09: *
10: * @author Tin Pavlinic
11: * @version $Revision: 496 $
12: */
13: public class FloatReturnTest extends TestCase {
14: private static final float FLOAT_THRESHOLD = 1.0e-20f;
15: private static final double DOUBLE_THRESHOLD = 1.0e-20;
16:
17: public void testFloat() {
18: assertEquals(-1.0f, new FloatReturn().getFloat(),
19: FLOAT_THRESHOLD);
20: }
21:
22: public void testDouble() {
23: assertEquals(-1.0, new FloatReturn().getDouble(),
24: DOUBLE_THRESHOLD);
25: }
26:
27: public static Test suite() {
28: return new TestSuite(FloatReturnTest.class);
29: }
30:
31: public static void main(String[] args) {
32: junit.textui.TestRunner.run(suite());
33: }
34: }
|