Search in sources :

Example 66 with FormatableBitSet

use of org.apache.derby.iapi.services.io.FormatableBitSet in project derby by apache.

the class FormatableBitSetTest method testIntCtor0.

// Test cases for single arg constructor
public void testIntCtor0() {
    FormatableBitSet zeroBits = new FormatableBitSet(0);
    assertEquals(0, zeroBits.getLength());
    assertEquals(0, zeroBits.getLengthInBytes());
    assertEquals(0, zeroBits.getNumBitsSet());
    assertTrue(zeroBits.invariantHolds());
    assertEquals(0, zeroBits.getByteArray().length);
}
Also used : FormatableBitSet(org.apache.derby.iapi.services.io.FormatableBitSet)

Example 67 with FormatableBitSet

use of org.apache.derby.iapi.services.io.FormatableBitSet in project derby by apache.

the class FormatableBitSetTest method testANDWithEmpty.

public void testANDWithEmpty() {
    bitset18.and(new FormatableBitSet());
    assertEquals(0, bitset18.getNumBitsSet());
    assertTrue(bitset18.invariantHolds());
}
Also used : FormatableBitSet(org.apache.derby.iapi.services.io.FormatableBitSet)

Example 68 with FormatableBitSet

use of org.apache.derby.iapi.services.io.FormatableBitSet in project derby by apache.

the class FormatableBitSetTest method numBitsSetInTwoBytes.

// test getNumBitsSet() for a two-byte bit set
public void numBitsSetInTwoBytes() throws Exception {
    for (int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; ++i) {
        final byte b1 = (byte) i;
        final int bits1 = bitsInByte(b1);
        for (int j = Byte.MIN_VALUE; j <= Byte.MAX_VALUE; ++j) {
            final byte b2 = (byte) j;
            FormatableBitSet bs = new FormatableBitSet(new byte[] { b1, b2 });
            assertEquals("invalid bit count for b1=" + b1 + " and b2=" + b2, bits1 + bitsInByte(b2), bs.getNumBitsSet());
        }
    }
}
Also used : FormatableBitSet(org.apache.derby.iapi.services.io.FormatableBitSet)

Example 69 with FormatableBitSet

use of org.apache.derby.iapi.services.io.FormatableBitSet in project derby by apache.

the class FormatableBitSetTest method testIntCtor1.

public void testIntCtor1() {
    FormatableBitSet oneBit = new FormatableBitSet(1);
    assertEquals(1, oneBit.getLength());
    assertEquals(1, oneBit.getLengthInBytes());
    assertEquals(0, oneBit.getNumBitsSet());
    assertTrue(oneBit.invariantHolds());
    assertEquals(1, oneBit.getByteArray().length);
}
Also used : FormatableBitSet(org.apache.derby.iapi.services.io.FormatableBitSet)

Example 70 with FormatableBitSet

use of org.apache.derby.iapi.services.io.FormatableBitSet in project derby by apache.

the class FormatableBitSetTest method testORWithEmpty.

public void testORWithEmpty() {
    FormatableBitSet cpy = new FormatableBitSet(bitset18);
    bitset18.or(empty);
    assertEquals(9, bitset18.getNumBitsSet());
    assertTrue(cpy.equals(bitset18));
    assertTrue(bitset18.invariantHolds());
}
Also used : FormatableBitSet(org.apache.derby.iapi.services.io.FormatableBitSet)

Aggregations

FormatableBitSet (org.apache.derby.iapi.services.io.FormatableBitSet)146 DataValueDescriptor (org.apache.derby.iapi.types.DataValueDescriptor)36 RowLocation (org.apache.derby.iapi.types.RowLocation)32 SQLLongint (org.apache.derby.iapi.types.SQLLongint)25 ScanController (org.apache.derby.iapi.store.access.ScanController)24 ExecRow (org.apache.derby.iapi.sql.execute.ExecRow)23 ConglomerateController (org.apache.derby.iapi.store.access.ConglomerateController)18 StandardException (org.apache.derby.shared.common.error.StandardException)17 RawTransaction (org.apache.derby.iapi.store.raw.xact.RawTransaction)15 RawContainerHandle (org.apache.derby.iapi.store.raw.data.RawContainerHandle)13 TransactionController (org.apache.derby.iapi.store.access.TransactionController)12 ConglomerateDescriptor (org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor)11 SQLInteger (org.apache.derby.iapi.types.SQLInteger)11 UUID (org.apache.derby.catalog.UUID)10 ExecIndexRow (org.apache.derby.iapi.sql.execute.ExecIndexRow)10 ConstraintDescriptor (org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor)9 DataDictionary (org.apache.derby.iapi.sql.dictionary.DataDictionary)7 SQLChar (org.apache.derby.iapi.types.SQLChar)7 Properties (java.util.Properties)6 ContextManager (org.apache.derby.iapi.services.context.ContextManager)6