Skip to content

Commit

Permalink
ref[JS]: js protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 15, 2024
1 parent 0b0b337 commit 6fbb0b9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions protocol/src/main/resources/csharp/Buffer/ByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void SetWriteOffset(int writeIndex)
throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " +
readOffset +
", writeOffset: " + writeOffset +
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length) + ")";
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length + ")");
}
writeOffset = writeIndex;
}
Expand All @@ -108,7 +108,7 @@ public void SetReadOffset(int readIndex)
{
throw new Exception("readIndex[" + readIndex + "] out of bounds exception: readIndex: " + readOffset +
", writeOffset: " + writeOffset +
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length) + ")";
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length + ")");
}
readOffset = readIndex;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ByteBuffer = function() {
if (writeIndex > this.buffer.byteLength) {
throw new Error('writeIndex out of bounds exception: readOffset: ' + this.readOffset +
', writeOffset: ' + this.writeOffset +
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength) + ')';
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')');
}
this.writeOffset = writeIndex;
};
Expand Down
4 changes: 2 additions & 2 deletions protocol/src/test/cpp/zfoocpp/ByteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace zfoo {
"writeIndex[" + std::to_string(writeIndex) + "] out of bounds exception: readOffset: " +
std::to_string(readOffset) +
", writeOffset: " + std::to_string(writeOffset) +
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + std::to_string(max_capacity);
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + std::to_string(max_capacity) + ")";
throw errorMessage;
}
writeOffset = writeIndex;
Expand All @@ -135,7 +135,7 @@ namespace zfoo {
"readIndex[" + std::to_string(readIndex) + "] out of bounds exception: readOffset: " +
std::to_string(readOffset) +
", writeOffset: " + std::to_string(writeOffset) +
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + std::to_string(max_capacity);
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + std::to_string(max_capacity) + ")";
throw errorMessage;
}
readOffset = readIndex;
Expand Down
4 changes: 2 additions & 2 deletions protocol/src/test/csharp/zfoocs/Buffer/ByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void SetWriteOffset(int writeIndex)
throw new Exception("writeIndex[" + writeIndex + "] out of bounds exception: readOffset: " +
readOffset +
", writeOffset: " + writeOffset +
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length);
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length + ")");
}
writeOffset = writeIndex;
}
Expand All @@ -108,7 +108,7 @@ public void SetReadOffset(int readIndex)
{
throw new Exception("readIndex[" + readIndex + "] out of bounds exception: readIndex: " + readOffset +
", writeOffset: " + writeOffset +
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length);
"(expected: 0 <= readOffset <= writeOffset <= capacity:" + buffer.Length + ")");
}
readOffset = readIndex;
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/src/test/javascript/zfoojs/buffer/ByteBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ByteBuffer = function() {
if (writeIndex > this.buffer.byteLength) {
throw new Error('writeIndex out of bounds exception: readOffset: ' + this.readOffset +
', writeOffset: ' + this.writeOffset +
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength) + ')';
'(expected: 0 <= readOffset <= writeOffset <= capacity:' + this.buffer.byteLength + ')');
}
this.writeOffset = writeIndex;
};
Expand Down

0 comments on commit 6fbb0b9

Please sign in to comment.