diff options
Diffstat (limited to 'src/tests/ringbuffer.cpp')
-rw-r--r-- | src/tests/ringbuffer.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/tests/ringbuffer.cpp b/src/tests/ringbuffer.cpp deleted file mode 100644 index da5126c..0000000 --- a/src/tests/ringbuffer.cpp +++ /dev/null | |||
@@ -1,38 +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/ringbuffer.h" | ||
9 | #include <stdlib.h> | ||
10 | #include <stdint.h> | ||
11 | #include <stdio.h> | ||
12 | |||
13 | int main() | ||
14 | { | ||
15 | Bu::RingBuffer<uint32_t> ibuf( 10 ); | ||
16 | |||
17 | for( int k = 0; k < 2; k++ ) | ||
18 | { | ||
19 | int j = 1; | ||
20 | for(; j < 7; j++ ) | ||
21 | { | ||
22 | ibuf.enqueue( j ); | ||
23 | } | ||
24 | |||
25 | for(; j < 20; j++ ) | ||
26 | { | ||
27 | ibuf.enqueue( j ); | ||
28 | printf("- %d\n", ibuf.dequeue() ); | ||
29 | } | ||
30 | |||
31 | for(;;) | ||
32 | { | ||
33 | if( ibuf.isEmpty() ) break; | ||
34 | printf(". %d\n", ibuf.dequeue() ); | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | |||