Skip to content

Commit c49d75d

Browse files
committed
Magic bytes change fallout
1 parent 1002c26 commit c49d75d

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

core/src/test/java/io/questdb/client/test/cutlass/qwp/client/NativeBufferWriterTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626

2727
import io.questdb.client.cutlass.qwp.client.NativeBufferWriter;
2828
import io.questdb.client.std.Unsafe;
29-
import static io.questdb.client.test.tools.TestUtils.assertMemoryLeak;
3029
import org.junit.Assert;
3130
import org.junit.Test;
3231

32+
import static io.questdb.client.test.tools.TestUtils.assertMemoryLeak;
3333
import static org.junit.Assert.*;
3434

3535
public class NativeBufferWriterTest {
@@ -66,10 +66,10 @@ public void testGrowBuffer() throws Exception {
6666
public void testMultipleWrites() throws Exception {
6767
assertMemoryLeak(() -> {
6868
try (NativeBufferWriter writer = new NativeBufferWriter()) {
69-
writer.putByte((byte) 'I');
70-
writer.putByte((byte) 'L');
69+
writer.putByte((byte) 'Q');
70+
writer.putByte((byte) 'W');
7171
writer.putByte((byte) 'P');
72-
writer.putByte((byte) '4');
72+
writer.putByte((byte) '1');
7373
writer.putByte((byte) 1); // Version
7474
writer.putByte((byte) 0); // Flags
7575
writer.putShort((short) 1); // Table count

core/src/test/java/io/questdb/client/test/cutlass/qwp/client/QwpWebSocketEncoderTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
import io.questdb.client.cutlass.qwp.client.QwpWebSocketEncoder;
3030
import io.questdb.client.cutlass.qwp.protocol.QwpTableBuffer;
3131
import io.questdb.client.std.Unsafe;
32-
import static io.questdb.client.test.tools.TestUtils.assertMemoryLeak;
3332
import org.junit.Assert;
3433
import org.junit.Test;
3534

3635
import static io.questdb.client.cutlass.qwp.protocol.QwpConstants.*;
36+
import static io.questdb.client.test.tools.TestUtils.assertMemoryLeak;
3737

3838
/**
3939
* Unit tests for QwpWebSocketEncoder.
@@ -446,10 +446,10 @@ public void testEncodeMultipleColumns() throws Exception {
446446
// Verify header
447447
QwpBufferWriter buf = encoder.getBuffer();
448448
long ptr = buf.getBufferPtr();
449-
Assert.assertEquals((byte) 'I', Unsafe.getUnsafe().getByte(ptr));
450-
Assert.assertEquals((byte) 'L', Unsafe.getUnsafe().getByte(ptr + 1));
449+
Assert.assertEquals((byte) 'Q', Unsafe.getUnsafe().getByte(ptr));
450+
Assert.assertEquals((byte) 'W', Unsafe.getUnsafe().getByte(ptr + 1));
451451
Assert.assertEquals((byte) 'P', Unsafe.getUnsafe().getByte(ptr + 2));
452-
Assert.assertEquals((byte) '4', Unsafe.getUnsafe().getByte(ptr + 3));
452+
Assert.assertEquals((byte) '1', Unsafe.getUnsafe().getByte(ptr + 3));
453453
}
454454
});
455455
}
@@ -692,10 +692,10 @@ public void testEncodeSingleRowWithLong() throws Exception {
692692
long ptr = buf.getBufferPtr();
693693

694694
// Verify header magic
695-
Assert.assertEquals((byte) 'I', Unsafe.getUnsafe().getByte(ptr));
696-
Assert.assertEquals((byte) 'L', Unsafe.getUnsafe().getByte(ptr + 1));
695+
Assert.assertEquals((byte) 'Q', Unsafe.getUnsafe().getByte(ptr));
696+
Assert.assertEquals((byte) 'W', Unsafe.getUnsafe().getByte(ptr + 1));
697697
Assert.assertEquals((byte) 'P', Unsafe.getUnsafe().getByte(ptr + 2));
698-
Assert.assertEquals((byte) '4', Unsafe.getUnsafe().getByte(ptr + 3));
698+
Assert.assertEquals((byte) '1', Unsafe.getUnsafe().getByte(ptr + 3));
699699

700700
// Version
701701
Assert.assertEquals(VERSION_1, Unsafe.getUnsafe().getByte(ptr + 4));

0 commit comments

Comments
 (0)