public class TestSuccessorUtil extends TestCase2
SuccessorUtil.TestCase2.MyProperties, TestCase2.RandomType_randomType, log| Constructor and Description |
|---|
TestSuccessorUtil() |
TestSuccessorUtil(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
test_bitString_successor()
Test computation of the successor of a fixed length bit string.
|
void |
test_double_data_points() |
void |
test_float_data_points() |
void |
test_keyBuilder_successor_float_data()
The value space for
float and double is
complex. |
void |
test_keyBuilder_successor_float_maxValue()
Verifies that successor of the maximum float value is positive infinity.
|
void |
test_keyBuilder_successor_float_NaN()
Verifies that there is no successor for a NaN.
|
void |
test_keyBuilder_successor_float_nearZero_data()
Verifies some data points that we use in the next test.
|
void |
test_keyBuilder_successor_float_nearZero()
Verifies that the successor function imposes the correct ordering as we
approach and cross zero from the positive region of the value space into
the negative region of the value space.
|
void |
test_keyBuilder_successor_float_negativeInfinity()
Verifies that there is no successor for negative infinity.
|
void |
test_keyBuilder_successor_float_negativeValue()
Test a few values from the middle of the negative region of the value
space.
|
void |
test_keyBuilder_successor_float_penultimateValue()
Verifies that the successor of the penultimate float is
correct.
|
void |
test_keyBuilder_successor_float_positiveInfinity()
Verifies that there is no successor for positive infinity.
|
void |
test_keyBuilder_successor_float_positiveValue()
Now verify the successor for each of the data points that we
verified in the previous test as being successors in the float
value space.
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getProperties, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logPropertiesassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toStringpublic TestSuccessorUtil()
public TestSuccessorUtil(String name)
name - public void test_float_data_points()
public void test_double_data_points()
public void test_keyBuilder_successor_float_data()
float and double is
complex. The "next" floating point value is defined in terms of the next
bit pattern for the underlying floating point representation. Also, we
have to be aware of the trade off between precision and magnitude, the
maximum expressible value, NaNs, positive and negative infinity, etc.
First we verify the data that we are going to use in the test. Each of these asserts verifies that a bit pattern, expressed as an int, is equilivant to the specified float. This SHOULD be true, but it is down to the metal enough to make it worth checking.
These test data were derived from: Comparing floating point numbers by Bruce Dawson.
public void test_keyBuilder_successor_float_positiveValue()
throws NoSuccessorException
NoSuccessorExceptionpublic void test_keyBuilder_successor_float_negativeValue()
throws NoSuccessorException
NoSuccessorExceptionpublic void test_keyBuilder_successor_float_nearZero_data()
public void test_keyBuilder_successor_float_nearZero()
throws NoSuccessorException
Note: The data points used in this test are verified by the previous test.
NoSuccessorExceptionpublic void test_keyBuilder_successor_float_penultimateValue()
throws NoSuccessorException
NoSuccessorExceptionpublic void test_keyBuilder_successor_float_maxValue()
throws NoSuccessorException
NoSuccessorExceptionpublic void test_keyBuilder_successor_float_NaN()
public void test_keyBuilder_successor_float_negativeInfinity()
public void test_keyBuilder_successor_float_positiveInfinity()
public void test_bitString_successor()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.