From ea9c6b32e952e1d87872b992989854e4899cb8f8 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Oct 2010 20:57:50 +0000 Subject: Corrected a bug that made negative numbers between -64 and -127 inclusive corrupt. --- src/tests/int.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tests/int.cpp') diff --git a/src/tests/int.cpp b/src/tests/int.cpp index 5d5b7d2..1601578 100644 --- a/src/tests/int.cpp +++ b/src/tests/int.cpp @@ -8,13 +8,17 @@ using namespace Bu; int main() { MemBuf mb; - int64_t i = -53954321995838ll; + int64_t i = -(100); sio << "Before: " << i << sio.nl; Gats::Integer::writePackedInt( mb, i ); + mb.write("aaa", 3 ); mb.setPos( 0 ); Gats::Integer::readPackedInt( mb, i ); sio << "After: " << i << sio.nl; + char buf[4]; + buf[mb.read( buf, 3 )] = '\0'; + sio << "Extra: \"" << buf << "\"" << sio.nl; return 0; } -- cgit v1.2.3