From 74dd68ad611d15abf16a65c36a7cfd3f4492930a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2012 16:25:22 +0000 Subject: Made the repo less libbu++-centric. --- src/tests/clone.cpp | 22 ---------------------- src/tests/dump.cpp | 30 ------------------------------ src/tests/int.cpp | 47 ----------------------------------------------- 3 files changed, 99 deletions(-) delete mode 100644 src/tests/clone.cpp delete mode 100644 src/tests/dump.cpp delete mode 100644 src/tests/int.cpp (limited to 'src/tests') diff --git a/src/tests/clone.cpp b/src/tests/clone.cpp deleted file mode 100644 index 8533376..0000000 --- a/src/tests/clone.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "gats/types.h" - -#include - -using namespace Bu; - -int main( int argc, char *argv[] ) -{ - Gats::Object *pBase = Gats::Object::strToGats("{\"Thing\": 3.14159, \"bool\": true, \"list\":[\"string\",44,{\"Stuff\":{\"list\":[],\"what?\":false}}]}"); - - sio << *pBase << sio.nl; - - Gats::Object *pNew = pBase->clone(); - delete pBase; - - sio << *pNew << sio.nl; - - delete pNew; - - return 0; -} - diff --git a/src/tests/dump.cpp b/src/tests/dump.cpp deleted file mode 100644 index e0dcb52..0000000 --- a/src/tests/dump.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include -#include - -using namespace Bu; - -int main( int argc, char *argv[] ) -{ - File fIn( argv[1], File::Read ); - Gats::GatsStream gsIn( fIn ); - - for(;;) - { - sio << "Reading from file position: " << fIn.tell() << sio.nl; - Gats::Object *pObj = gsIn.readObject(); - if( !pObj ) - { - if( gsIn.hasReadBuffer() ) - { - sio << "Premature end of stream detected, have " - << gsIn.getReadBufferSize() << "b." << sio.nl; - } - return 0; - } - - sio << *pObj << sio.nl; - } -} - diff --git a/src/tests/int.cpp b/src/tests/int.cpp deleted file mode 100644 index c19df9c..0000000 --- a/src/tests/int.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "gats/integer.h" - -#include -#include -#include - -using namespace Bu; - -void hexdump( char *dat, int iSize ) -{ - static const char *hex="0123456789ABCDEF"; - printf("----\n"); - for( int j = 0; j < iSize; j += 8 ) - { - for( int k = j; /*k < iSize &&*/ k < j+8; k++ ) - printf((k>4)&0x0F], hex[dat[k]&0x0F] ); - printf("| "); - for( int k = j; k < iSize && k < j+8; k++ ) - printf("%c ", (dat[k]>13&&dat[k]<127)?(dat[k]):('.') ); - printf("\n"); - } - printf("----\n"); -} - -int main( int argc, char *argv[] ) -{ - for( int j = 1; j < argc; j++ ) - { - int64_t i = strtoll( argv[j], NULL, 10 ); - MemBuf mb; - Gats::Integer::writePackedInt( mb, i ); - hexdump( mb.getString().getStr(), mb.getString().getSize() ); - } -/* - 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