public class TestWormAddressManager
extends junit.framework.TestCase
WormAddressManager
.Constructor and Description |
---|
TestWormAddressManager() |
TestWormAddressManager(String name) |
Modifier and Type | Method and Description |
---|---|
void |
doTestGet(int offsetBits,
int limit)
Helper performs random tests of
WormAddressManager.toAddr(int, long)
and is intended to verify both consistency of encoding and decoding and
correct rejection when encoding. |
static long |
nextAddr(Random r,
WormAddressManager am)
Returns a legal random address and NULL 5% of the time.
|
static int |
nextByteCount(Random r,
WormAddressManager am)
Next random byte count in [0:maxByteCount], but never more than
Integer.MAX_VALUE bytes and zero (0) 5% of the time. |
static long |
nextNonZeroAddr(Random r,
WormAddressManager am)
Returns a legal random non-NULL address.
|
static long |
nextNonZeroAddr(Random r,
WormAddressManager am,
long limit)
Returns a legal random non-NULL address that does not extend as far as
limit.
|
static int |
nextNonZeroByteCount(Random r,
WormAddressManager am)
Next random legal non-zero byte count less than maxByteCount and never
more than
Integer.MAX_VALUE bytes. |
static long |
nextNonZeroOffset(Random r,
WormAddressManager am)
Next non-zero random byte offset less than maxOffset.
|
static long |
nextOffset(Random r,
WormAddressManager am)
Next random byte offset and
0L 5% of the time. |
void |
test_canNotConstructNULLs()
Verify that
WormAddressManager.toAddr(int, long) will reject a zero
byte count or a zero offset since the value 0L is reserved
to represent a null reference. |
void |
test_ctor_32bits()
Test of constructor when splitting the long integer into two 32-bit
unsigned integer components (offset and #bytes).
|
void |
test_ctor_48bits()
Test of constructor when splitting the long integer into a 48-bit
unsigned integer (offset) and a 16-bit unsigned integer (#bytes).
|
void |
test_ctor_correctRejection() |
void |
test_encodeDecode_offsetBits32_01()
One of a series of tests of encoding and decoding addresses that have
proven themselves to be edge conditions in the code.
|
void |
test_encodeDecode_offsetBits48_01() |
void |
test_get_32()
Test of encoding and decoding addressed with a small set of 32 bit
offsets.
|
void |
test_get_48()
Test of encoding and decoding addressed with a small set of 48 bit
offsets.
|
void |
test_get()
Test of encoding and decoding addresses with a set of addresses selected
from each of the legal values of the offsetBits.
|
void |
test_static_getMaxByteCount() |
void |
test_toAddr_correctRejection_byteCount()
Test that
IAddressManager.toAddr(int, long) will correctly reject
requests where the byte count is invalid. |
void |
test_toAddr_correctRejection_byteOffset()
Test that
IAddressManager.toAddr(int, long) will correctly reject
requests where the byte offset is invalid. |
assertEquals, 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, toString
public TestWormAddressManager()
public TestWormAddressManager(String name)
public void test_ctor_32bits()
public void test_ctor_48bits()
public void test_ctor_correctRejection()
public void test_canNotConstructNULLs()
WormAddressManager.toAddr(int, long)
will reject a zero
byte count or a zero offset since the value 0L
is reserved
to represent a null reference.public void test_get_32()
public void test_get_48()
public void test_get()
public void doTestGet(int offsetBits, int limit)
WormAddressManager.toAddr(int, long)
and is intended to verify both consistency of encoding and decoding and
correct rejection when encoding.offsetBits
- public static long nextAddr(Random r, WormAddressManager am)
public static long nextNonZeroAddr(Random r, WormAddressManager am)
public static long nextNonZeroAddr(Random r, WormAddressManager am, long limit)
limit
- The first byte that must not be covered by the returned
address.public static int nextByteCount(Random r, WormAddressManager am)
Integer.MAX_VALUE
bytes and zero (0) 5% of the time.public static int nextNonZeroByteCount(Random r, WormAddressManager am)
Integer.MAX_VALUE
bytes.public static long nextOffset(Random r, WormAddressManager am)
0L
5% of the time.public static long nextNonZeroOffset(Random r, WormAddressManager am)
public void test_encodeDecode_offsetBits32_01()
public void test_encodeDecode_offsetBits48_01()
public void test_static_getMaxByteCount()
public void test_toAddr_correctRejection_byteCount()
IAddressManager.toAddr(int, long)
will correctly reject
requests where the byte count is invalid.public void test_toAddr_correctRejection_byteOffset()
IAddressManager.toAddr(int, long)
will correctly reject
requests where the byte offset is invalid.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.