public class TestUnsignedIVs extends TestCase2
DTE
for each of these cases, e.g.,
DTE.XSDUnsignedByte
. In each case, the corresponding signed primitive
is used to encode the IV
so we represent the unsigned byte in one
byte, just as we represent the signed byte.
These IVs differ in that they must use a widening promotion when they expose
the unsigned value to callers. This is done in a manner similar to
KeyBuilder
. First we use a widening promotion, e.g., from byte to
short. Then we apply the rules to convert from an signed short into an
unsigned short. The unsigned short is reported to the caller. The edge case
is when we must promote a long. In this case, we promote it to a
BigInteger
and then operate on that.
These IV
s also use a widening promotion when autoboxing the Java
primitive value in order to report it's unsigned value correctly. This the
Java numeric class used as the generic type parameter for
XSDUnsignedByte
is Short
and not Byte
.
TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Constructor and Description |
---|
TestUnsignedIVs() |
TestUnsignedIVs(String name) |
Modifier and Type | Method and Description |
---|---|
void |
test_xsd_unsignedByte()
xsd:unsignedByte.
|
void |
test_xsd_unsignedInt() |
void |
test_xsd_unsignedLong() |
void |
test_xsd_unsignedShort()
Unit test for xsd:unsignedShort.
|
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, logProperties
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 TestUnsignedIVs()
public TestUnsignedIVs(String name)
name
- public void test_xsd_unsignedByte()
Points of interest in the value space as reported by KeyBuilder
.
kmin(-128)=[0] // unsigned zero km1(-1)=[127] k0(0)=[128] kp1(1)=[129] kmax(127)=[255]FIXME The guts of all this should be concentrated somewhere. The data from KeyBuilder is useful but not complete (it does not show us the unsigned version of the value, which is after all what we are after). There are lots of little edges for when something is interpreted as signed and unsigned and especially the ordering implied by those things using different comparators.
public void test_xsd_unsignedShort()
Points of interest in the value space as reported by KeyBuilder
.
kmin(-32768)=[0, 0] // unsigned zero. km1(-1)=[127, 255] k0(0)=[128, 0] kp1(1)=[128, 1] kmax(32767)=[255, 255]
public void test_xsd_unsignedInt()
public void test_xsd_unsignedLong()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.