aboutsummaryrefslogtreecommitdiff
path: root/common/composite/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/composite/driver.cxx')
-rw-r--r--common/composite/driver.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx
index 4f4d720..a7bc26e 100644
--- a/common/composite/driver.cxx
+++ b/common/composite/driver.cxx
@@ -27,8 +27,12 @@ main (int argc, char* argv[])
{
auto_ptr<database> db (create_database (argc, argv));
+ // Test basic composite functionality.
+ //
for (unsigned short i (0); i < 2; ++i)
{
+ using namespace test1;
+
person p (1);
p.name_.first = "Joe";
p.name_.last = "Dirt";
@@ -125,6 +129,8 @@ main (int argc, char* argv[])
// Test composite class template instantiation.
//
{
+ using namespace test2;
+
object o (1);
o.comp_.num = 123;
@@ -158,6 +164,33 @@ main (int argc, char* argv[])
assert (o == *o1);
}
}
+
+ // Test empty column name.
+ //
+ {
+ using namespace test3;
+
+ object o (1);
+ o.c_.str = "abc";
+
+ // persist
+ //
+ {
+ transaction t (db->begin ());
+ db->persist (o);
+ t.commit ();
+ }
+
+ // load & check
+ //
+ {
+ transaction t (db->begin ());
+ auto_ptr<object> o1 (db->load<object> (1));
+ t.commit ();
+
+ assert (o == *o1);
+ }
+ }
}
catch (const odb::exception& e)
{