public class LongPackerTestCase
extends junit.framework.TestCase
LongPacker
.Modifier and Type | Field and Description |
---|---|
static long |
SIGN_MASK |
Constructor and Description |
---|
LongPackerTestCase() |
LongPackerTestCase(String name) |
Modifier and Type | Method and Description |
---|---|
static void |
assertEquals(String msg,
byte[] expected,
byte[] actual) |
void |
doPackTest(long v,
byte[] expected) |
void |
doStressTest(int ntrials,
com.bigdata.io.LongPackerTestCase.LongGenerator g)
Run a stress test.
|
void |
doUnpackTest(long expected,
byte[] packed)
Unpacks a long.
|
int |
getNBytes(int firstByte)
Given the first byte of a packed long value, return the #of bytes into which
that value was packed (including this one).
|
void |
test_getNibbleLength() |
void |
testHighBit() |
void |
testNBytes() |
void |
testPack() |
void |
testStressRandom()
Run a large #of random pack/unpack operations to sample the space while
showing correctness on those samples.
|
void |
testStressSequence()
Run a large #of pack/unpack operations on a sequence of long values to
demonstrate correctness in that sequence.
|
void |
testUnpack() |
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 static final long SIGN_MASK
public LongPackerTestCase()
public LongPackerTestCase(String name)
name
- public void doUnpackTest(long expected, byte[] packed) throws IOException
expected
- The expected long value.packed
- The packed byte[].IOException
- If there was not enough data.junit.framework.AssertionFailedError
- If there is too much data.public int getNBytes(int firstByte)
firstByte
- The first byte.public void testNBytes()
public void testUnpack() throws IOException
IOException
public void doPackTest(long v, byte[] expected) throws IOException
IOException
public void test_getNibbleLength()
public void testPack() throws IOException
IOException
public void testHighBit()
public void testStressSequence() throws IOException
IOException
public void testStressRandom() throws IOException
IOException
public void doStressTest(int ntrials, com.bigdata.io.LongPackerTestCase.LongGenerator g) throws IOException
ntrials
- #of trials.g
- Generator for the long values.IOException
public static void assertEquals(String msg, byte[] expected, byte[] actual)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.