summaryrefslogtreecommitdiff
path: root/src/tests/atom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/atom.cpp')
-rw-r--r--src/tests/atom.cpp25
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
5typedef struct bob
6{
7 int a, b;
8} bob;
9int 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