diff options
Diffstat (limited to 'src/tests/queuebuf.cpp')
-rw-r--r-- | src/tests/queuebuf.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/queuebuf.cpp b/src/tests/queuebuf.cpp new file mode 100644 index 0000000..accc723 --- /dev/null +++ b/src/tests/queuebuf.cpp | |||
@@ -0,0 +1,23 @@ | |||
1 | #include <bu/queuebuf.h> | ||
2 | #include <bu/sio.h> | ||
3 | |||
4 | using namespace Bu; | ||
5 | |||
6 | int main() | ||
7 | { | ||
8 | static const char *src = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%#"; | ||
9 | QueueBuf qb; | ||
10 | |||
11 | for( int j = 0; j < 8; j++ ) | ||
12 | { | ||
13 | qb.write( src, 60 ); | ||
14 | } | ||
15 | |||
16 | char buf[11]; | ||
17 | while( !qb.isEos() ) | ||
18 | { | ||
19 | buf[qb.read( buf, 9 )] = '\0'; | ||
20 | sio << "Read: >>" << buf << "<<" << sio.nl; | ||
21 | } | ||
22 | } | ||
23 | |||