test[php]: php protocol test

This commit is contained in:
godotg committed 2024-07-16 15:32:26 +08:00
1 parent 60ec9a71d7
commit 8d343b30a0
2 files changed
+8 -8

No files matched your search

@@ -61,8 +61,8 @@ class ByteBuffer
public function setWriteOffset(int $writeIndex): void
{
if ($writeIndex > strlen($this->buffer)) {
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer) . ")");
}
$this->writeOffset = $writeIndex;
}
@@ -78,8 +78,8 @@ class ByteBuffer
public function setReadOffset(int $readIndex): void
{
if ($readIndex > $this->writeOffset) {
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer));
}
$this->readOffset = $readIndex;
}
+4 -4
View File
@@ -61,8 +61,8 @@ class ByteBuffer
public function setWriteOffset(int $writeIndex): void
{
if ($writeIndex > strlen($this->buffer)) {
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
throw new Exception("writeIndex[" . $writeIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer) . ")");
}
$this->writeOffset = $writeIndex;
}
@@ -78,8 +78,8 @@ class ByteBuffer
public function setReadOffset(int $readIndex): void
{
if ($readIndex > $this->writeOffset) {
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readerIndex: " . $this->readOffset .
", writerIndex: " . $this->writeOffset . "(expected: 0 <= readerIndex <= writerIndex <= capacity:" . strlen($this->buffer));
throw new Exception("readIndex[" . $readIndex . "] out of bounds exception: readOffset: " . $this->readOffset .
", writeOffset: " . $this->writeOffset . "(expected: 0 <= readOffset <= writeOffset <= capacity:" . strlen($this->buffer));
}
$this->readOffset = $readIndex;
}