diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-07-03 00:28:59 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-07-03 00:28:59 +0000 |
commit | ac517a2b7625e0aa0862679e961c6349f859ea3b (patch) | |
tree | e3e27a6b9bd5e2be6150088495c91fc91786ad9d /src/tests/atom.cpp | |
parent | f8d4301e9fa4f3709258505941e37fab2eadadc6 (diff) | |
parent | bd865cee5f89116c1f054cd0e5c275e97c2d0a9b (diff) | |
download | libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.gz libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.bz2 libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.xz libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.zip |
The reorg is being put in trunk, I think it's ready. Now we just get to find
out how many applications won't work anymore :)
Diffstat (limited to 'src/tests/atom.cpp')
-rw-r--r-- | src/tests/atom.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/atom.cpp b/src/tests/atom.cpp new file mode 100644 index 0000000..2077bfd --- /dev/null +++ b/src/tests/atom.cpp | |||
@@ -0,0 +1,25 @@ | |||
1 | #include "bu/atom.h" | ||
2 | #include <stdio.h> | ||
3 | #include <stdlib.h> | ||
4 | |||
5 | typedef struct bob | ||
6 | { | ||
7 | int a, b; | ||
8 | } bob; | ||
9 | int main() | ||
10 | { | ||
11 | Bu::Atom<int> aInt; | ||
12 | Bu::Atom<char *> aStr; | ||
13 | Bu::Atom<bob> aBob; | ||
14 | |||
15 | aBob = bob(); | ||
16 | aBob->a = 5; | ||
17 | |||
18 | aStr.set("Hey there, dude"); | ||
19 | aInt.set( 55 ); | ||
20 | int me = aInt; | ||
21 | aInt = 12; | ||
22 | printf("%d, %d\n", aInt.get(), me ); | ||
23 | printf("%s\n", aStr.get() ); | ||
24 | } | ||
25 | |||