diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-03-30 22:33:41 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-03-30 22:33:41 +0000 |
commit | 4b9289cfb260f4bcecaf23a810584ef6ef8e8501 (patch) | |
tree | 79136af08c7e42ba3322f0d73e9779e4354b318a /src/tests/buffer.cpp | |
parent | c7636dc954eddfe58f7959392602fbc9072d77e7 (diff) | |
download | libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.tar.gz libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.tar.bz2 libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.tar.xz libbu++-4b9289cfb260f4bcecaf23a810584ef6ef8e8501.zip |
Ok, string stuff is working much, much better, a load of new unit tests have
been added, and I deleted a whole slew of stupid old tests that I don't need.
Diffstat (limited to 'src/tests/buffer.cpp')
-rw-r--r-- | src/tests/buffer.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/tests/buffer.cpp b/src/tests/buffer.cpp deleted file mode 100644 index f3f6f41..0000000 --- a/src/tests/buffer.cpp +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #include "bu/membuf.h" | ||
9 | #include "bu/buffer.h" | ||
10 | #include "bu/file.h" | ||
11 | |||
12 | using namespace Bu; | ||
13 | |||
14 | int main( int argc, char *argv[] ) | ||
15 | { | ||
16 | argc--,argv++; | ||
17 | if( argc == 0 ) | ||
18 | { | ||
19 | MemBuf mOut; | ||
20 | Buffer bOut( mOut, 10 ); | ||
21 | |||
22 | for( int j = 0; j < 4; j++ ) | ||
23 | bOut.write("hi ", 3 ); | ||
24 | |||
25 | printf("Preflush: \"%s\"\n", mOut.getString().getStr() ); | ||
26 | bOut.flush(); | ||
27 | |||
28 | printf("Final: \"%s\"\n", mOut.getString().getStr() ); | ||
29 | } | ||
30 | else | ||
31 | { | ||
32 | File fIn( *argv, File::Read ); | ||
33 | Buffer bIn( fIn, 10 ); | ||
34 | |||
35 | char buf[5]; | ||
36 | for( int j = 0; j < 5; j++ ) | ||
37 | { | ||
38 | buf[bIn.read( buf, 4 )] = '\0'; | ||
39 | printf("Four chars: \"%s\"\n", buf ); | ||
40 | } | ||
41 | } | ||
42 | |||
43 | return 0; | ||
44 | } | ||
45 | |||