You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2024/10/16 15:22:17 UTC

(shardingsphere) branch master updated: Add more test cases on MySQLPacketPayload (#33269)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 3992a4124d6 Add more test cases on MySQLPacketPayload (#33269)
3992a4124d6 is described below

commit 3992a4124d613e4085ab48ce8c0c4682dc89f64d
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed Oct 16 23:22:10 2024 +0800

    Add more test cases on MySQLPacketPayload (#33269)
---
 .../db/protocol/mysql/payload/MySQLPacketPayloadTest.java           | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/payload/MySQLPacketPayloadTest.java b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/payload/MySQLPacketPayloadTest.java
index 0e5064c7414..753f0a531a4 100644
--- a/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/payload/MySQLPacketPayloadTest.java
+++ b/db-protocol/mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/payload/MySQLPacketPayloadTest.java
@@ -170,6 +170,12 @@ class MySQLPacketPayloadTest {
         verify(byteBuf).writeLongLE(Double.valueOf(Math.pow(2D, 25D)).intValue() - 1L);
     }
     
+    @Test
+    void assertReadLong() {
+        when(byteBuf.readUnsignedByte()).thenReturn((short) 1);
+        assertThat(new MySQLPacketPayload(byteBuf, StandardCharsets.UTF_8).readLong(1), is(1L));
+    }
+    
     @Test
     void assertReadStringLenenc() {
         when(byteBuf.readUnsignedByte()).thenReturn((short) 0);