use of io.questdb.cairo.vm.api.MemoryARW in project questdb by bluestreak01.
the class MemoryCARWImplTest method testLongRndEven.
@Test
public void testLongRndEven() {
try (MemoryARW mem = new MemoryCARWImpl(11, Integer.MAX_VALUE, MemoryTag.NATIVE_DEFAULT)) {
int n = 999;
long o = 0;
for (int i = n; i > 0; i--) {
mem.putLong(o, i);
o += 8;
}
o = 0;
for (int i = n; i > 0; i--) {
assertEquals(i, mem.getLong(o));
o += 8;
}
}
}
use of io.questdb.cairo.vm.api.MemoryARW in project questdb by bluestreak01.
the class MemoryCARWImplTest method testLong256.
@Test
public void testLong256() {
try (MemoryARW mem = new MemoryCARWImpl(256, Integer.MAX_VALUE, MemoryTag.NATIVE_DEFAULT)) {
mem.putLong256("0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8");
mem.putLong256("0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8");
}
}
use of io.questdb.cairo.vm.api.MemoryARW in project questdb by bluestreak01.
the class MemoryCARWImplTest method testJumpTo3.
@Test
public void testJumpTo3() {
try (MemoryARW mem = new MemoryCARWImpl(11, Integer.MAX_VALUE, MemoryTag.NATIVE_DEFAULT)) {
mem.jumpTo(256);
int n = 999;
for (int i = n; i > 0; i--) {
mem.putLong(i);
}
long o = 256;
for (int i = n; i > 0; i--) {
assertEquals(i, mem.getLong(o));
o += 8;
}
mem.jumpTo(0);
mem.jumpTo(5);
mem.jumpTo(0);
for (int i = n; i > 0; i--) {
mem.putLong(i);
}
o = 0;
for (int i = n; i > 0; i--) {
assertEquals(i, mem.getLong(o));
o += 8;
}
}
}
use of io.questdb.cairo.vm.api.MemoryARW in project questdb by bluestreak01.
the class MemoryCARWImplTest method testShort.
@Test
public void testShort() {
try (MemoryARW mem = new MemoryCARWImpl(7, Integer.MAX_VALUE, MemoryTag.NATIVE_DEFAULT)) {
mem.putByte((byte) 1);
short n = 999;
for (short i = n; i > 0; i--) {
mem.putShort(i);
}
long o = 1;
assertEquals(1, mem.getByte(0));
for (short i = n; i > 0; i--) {
assertEquals(i, mem.getShort(o));
o += 2;
}
}
}
use of io.questdb.cairo.vm.api.MemoryARW in project questdb by bluestreak01.
the class MemoryCARWImplTest method testLongRndCompatibility.
@Test
public void testLongRndCompatibility() {
long pageSize = 64;
try (MemoryARW mem = new MemoryCARWImpl(pageSize, Integer.MAX_VALUE, MemoryTag.NATIVE_DEFAULT)) {
mem.putLong(33, 8980980284302834L);
mem.putLong(12, 897928374972983477L);
assertEquals(8980980284302834L, mem.getLong(33));
assertEquals(897928374972983477L, mem.getLong(12));
}
}
Aggregations