aboutsummaryrefslogtreecommitdiff
path: root/test/containers.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-01-27 22:43:07 +0100
committerSebastian Geerken <devnull@localhost>2013-01-27 22:43:07 +0100
commit5eee444eaefbdcd3fb459c2a65376ef1fa873056 (patch)
treedb622afad4226b08f56d883d8f49f2ac0567d9fe /test/containers.cc
parentb81d6410ef72dee94915711bc5c777355a4dab20 (diff)
Test for containers. (Just curious how complete the code is ...)
Diffstat (limited to 'test/containers.cc')
-rw-r--r--test/containers.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/containers.cc b/test/containers.cc
new file mode 100644
index 00000000..9667564e
--- /dev/null
+++ b/test/containers.cc
@@ -0,0 +1,28 @@
+#include "../lout/object.hh"
+#include "../lout/container.hh"
+
+using namespace lout::object;
+using namespace lout::container::typed;
+
+void testHashTable ()
+{
+ HashTable<String, Integer> h(true, true);
+
+ h.put (new String ("one"), new Integer (1));
+ h.put (new String ("two"), new Integer (2));
+ h.put (new String ("three"), new Integer (3));
+
+ Iterator<String> it = h.iterator ();
+ while (it.hasNext ()) {
+ String *k = it.getNext ();
+ Integer *v = h.get (k);
+ printf ("%s -> %d\n", k->chars(), v->getValue());
+ }
+}
+
+int main (int argc, char *argv[])
+{
+ testHashTable ();
+
+ return 0;
+}