diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-08-09 05:30:34 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-08-09 05:30:34 +0000 |
commit | 4e86c50016ecfea40a72930cdd0460143f9edf4a (patch) | |
tree | e13c153b8042752a64134b3565e0e87a61d51398 /src/tests | |
parent | 9e48c6f7d602364eb1c18de7e1e4c00e4852839c (diff) | |
download | libbu++-4e86c50016ecfea40a72930cdd0460143f9edf4a.tar.gz libbu++-4e86c50016ecfea40a72930cdd0460143f9edf4a.tar.bz2 libbu++-4e86c50016ecfea40a72930cdd0460143f9edf4a.tar.xz libbu++-4e86c50016ecfea40a72930cdd0460143f9edf4a.zip |
Really, just a lot of documenting.
Diffstat (limited to 'src/tests')
-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 | |||