aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-10-20 20:57:50 +0000
committerMike Buland <eichlan@xagasoft.com>2010-10-20 20:57:50 +0000
commitea9c6b32e952e1d87872b992989854e4899cb8f8 (patch)
tree25ae6579ed24f39888488f6f759a2783f1b44fa9 /src/tests
parent811ab29d661266059abc28108d69c9a3e0b0fc88 (diff)
downloadlibgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.tar.gz
libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.tar.bz2
libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.tar.xz
libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.zip
Corrected a bug that made negative numbers between -64 and -127 inclusive
corrupt.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/int.cpp6
1 files changed, 5 insertions, 1 deletions
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;
8int main() 8int main()
9{ 9{
10 MemBuf mb; 10 MemBuf mb;
11 int64_t i = -53954321995838ll; 11 int64_t i = -(100);
12 12
13 sio << "Before: " << i << sio.nl; 13 sio << "Before: " << i << sio.nl;
14 Gats::Integer::writePackedInt( mb, i ); 14 Gats::Integer::writePackedInt( mb, i );
15 mb.write("aaa", 3 );
15 mb.setPos( 0 ); 16 mb.setPos( 0 );
16 Gats::Integer::readPackedInt( mb, i ); 17 Gats::Integer::readPackedInt( mb, i );
17 sio << "After: " << i << sio.nl; 18 sio << "After: " << i << sio.nl;
19 char buf[4];
20 buf[mb.read( buf, 3 )] = '\0';
21 sio << "Extra: \"" << buf << "\"" << sio.nl;
18 22
19 return 0; 23 return 0;
20} 24}