diff options
Diffstat (limited to '')
-rw-r--r-- | src/tests/console.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/console.cpp b/src/tests/console.cpp new file mode 100644 index 0000000..628482b --- /dev/null +++ b/src/tests/console.cpp | |||
@@ -0,0 +1,36 @@ | |||
1 | #include <bu/sio.h> | ||
2 | using namespace Bu; | ||
3 | |||
4 | #include <iostream> | ||
5 | using namespace std; | ||
6 | |||
7 | typedef struct Counter | ||
8 | { | ||
9 | Counter() : i( 0 ) | ||
10 | { | ||
11 | } | ||
12 | |||
13 | int get() | ||
14 | { | ||
15 | i++; | ||
16 | return i-1; | ||
17 | } | ||
18 | |||
19 | int i; | ||
20 | } Counter; | ||
21 | |||
22 | template<typename a> | ||
23 | void runtest( a &out ) | ||
24 | { | ||
25 | Counter c; | ||
26 | out << c.get() << ", " << c.get() << ", " << c.get() << ", " << c.get() << ", " << c.get() << "\n"; | ||
27 | } | ||
28 | |||
29 | int main() | ||
30 | { | ||
31 | runtest( cout ); | ||
32 | runtest( sio ); | ||
33 | |||
34 | return 0; | ||
35 | } | ||
36 | |||