Fixing range error introduces in v1.2.8 (#485)
This commit is contained in:
parent
f8f0bc1bd8
commit
a990fe95a0
|
@ -191,9 +191,9 @@ suite "Variable integer test suite":
|
||||||
|
|
||||||
for i in 0 ..< len(PBNegativeSignedEdgeValues):
|
for i in 0 ..< len(PBNegativeSignedEdgeValues):
|
||||||
check:
|
check:
|
||||||
vsizeof(hint64(PBNegativeSignedEdgeValues[i])) ==
|
vsizeof(cast[hint64](PBNegativeSignedEdgeValues[i])) ==
|
||||||
PBEdgeSignedNegativeSizes[i]
|
PBEdgeSignedNegativeSizes[i]
|
||||||
vsizeof(zint64(PBNegativeSignedEdgeValues[i])) ==
|
vsizeof(cast[zint64](PBNegativeSignedEdgeValues[i])) ==
|
||||||
PBEdgeSignedNegativeZigZagSizes[i]
|
PBEdgeSignedNegativeZigZagSizes[i]
|
||||||
|
|
||||||
test "[ProtoBuf] Success edge cases test":
|
test "[ProtoBuf] Success edge cases test":
|
||||||
|
@ -231,18 +231,18 @@ suite "Variable integer test suite":
|
||||||
buffer.setLen(PBEdgeSignedNegativeSizes[i])
|
buffer.setLen(PBEdgeSignedNegativeSizes[i])
|
||||||
check:
|
check:
|
||||||
putSVarint(buffer, length,
|
putSVarint(buffer, length,
|
||||||
hint64(PBNegativeSignedEdgeValues[i])).isOk()
|
cast[hint64](PBNegativeSignedEdgeValues[i])).isOk()
|
||||||
getSVarint(buffer, length, ivalue).isOk()
|
getSVarint(buffer, length, ivalue).isOk()
|
||||||
int64(ivalue) == int64(PBNegativeSignedEdgeValues[i])
|
int64(ivalue) == cast[int64](PBNegativeSignedEdgeValues[i])
|
||||||
toHex(buffer) == PBNegativeSignedEdgeExpects[i]
|
toHex(buffer) == PBNegativeSignedEdgeExpects[i]
|
||||||
|
|
||||||
buffer.setLen(PBEdgeSignedNegativeZigZagSizes[i])
|
buffer.setLen(PBEdgeSignedNegativeZigZagSizes[i])
|
||||||
check:
|
check:
|
||||||
putSVarint(buffer, length,
|
putSVarint(buffer, length,
|
||||||
zint64(PBNegativeSignedEdgeValues[i])).isOk()
|
cast[zint64](PBNegativeSignedEdgeValues[i])).isOk()
|
||||||
getSVarint(buffer, length, svalue).isOk()
|
getSVarint(buffer, length, svalue).isOk()
|
||||||
|
|
||||||
int64(svalue) == int64(PBNegativeSignedEdgeValues[i])
|
int64(svalue) == cast[int64](PBNegativeSignedEdgeValues[i])
|
||||||
toHex(buffer) == PBNegativeSignedZigZagEdgeExpects[i]
|
toHex(buffer) == PBNegativeSignedZigZagEdgeExpects[i]
|
||||||
|
|
||||||
test "[ProtoBuf] Buffer Overrun edge cases test":
|
test "[ProtoBuf] Buffer Overrun edge cases test":
|
||||||
|
|
Loading…
Reference in New Issue