public class ShortPackerTestCase
extends junit.framework.TestCase
ShortPacker.| Modifier and Type | Field and Description |
|---|---|
static long |
SIGN_MASK |
| Constructor and Description |
|---|
ShortPackerTestCase() |
ShortPackerTestCase(String name) |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertEquals(String msg,
byte[] expected,
byte[] actual) |
void |
doPackTest(short v,
byte[] expected) |
void |
doStressTest(int ntrials,
com.bigdata.io.ShortPackerTestCase.ShortGenerator g)
Run a stress test.
|
void |
doUnpackTest(short expected,
byte[] packed)
Unpacks a short value.
|
void |
test_rejectNegatives() |
void |
testHighBit() |
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 short 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, toStringpublic static final long SIGN_MASK
public ShortPackerTestCase()
public ShortPackerTestCase(String name)
name - public void doUnpackTest(short 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 void testUnpack()
throws IOException
IOExceptionpublic void doPackTest(short v,
byte[] expected)
throws IOException
IOExceptionpublic void testPack()
throws IOException
IOExceptionpublic void test_rejectNegatives()
throws IOException
IOExceptionpublic void testHighBit()
public void testStressSequence()
throws IOException
Short.MAX_VALUE by one (dense coverage).IOExceptionpublic void testStressRandom()
throws IOException
IOExceptionpublic void doStressTest(int ntrials,
com.bigdata.io.ShortPackerTestCase.ShortGenerator g)
throws IOException
ntrials - #of trials.g - Generator for the long values.IOExceptionpublic static void assertEquals(String msg, byte[] expected, byte[] actual)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.