aboutsummaryrefslogtreecommitdiff
path: root/common/access/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/access/driver.cxx')
-rw-r--r--common/access/driver.cxx34
1 files changed, 33 insertions, 1 deletions
diff --git a/common/access/driver.cxx b/common/access/driver.cxx
index 3e3c96d..79c63bf 100644
--- a/common/access/driver.cxx
+++ b/common/access/driver.cxx
@@ -37,9 +37,10 @@ main (int argc, char* argv[])
o.i2 (223);
o.i3 () = 323;
o.i4 () = 423;
- o.set_i5 (423);
+ o.set_i5 (523);
o.s1 ("1bc");
memcpy (o.b1 (), "123456789012345", 16);
+ o.b2 ("123456789012345");
{
transaction t (db->begin ());
@@ -219,6 +220,37 @@ main (int argc, char* argv[])
assert (o3.version_ == 2);
}
}
+
+ // Test basic accessor/modifier functionality.
+ //
+ {
+ using namespace test7;
+
+ object o (1);
+ o.i1 () = 123;
+ o.set_i2 (223);
+ o.setI3 (323);
+ o.seti4 (423);
+ o.i5 () = 523;
+ o.i6 () = 623;
+ o.SetI7 (723);
+ memcpy (o.b1 (), "123456789012345", 16);
+ o.b2 ("123456789012345");
+
+ {
+ transaction t (db->begin ());
+ db->persist (o);
+ t.commit ();
+ }
+
+ {
+ transaction t (db->begin ());
+ auto_ptr<object> p (db->load<object> (o.id_));
+ t.commit ();
+
+ assert (o == *p);
+ }
+ }
}
catch (const odb::exception& e)
{