diff options
Diffstat (limited to 'common/ctor')
-rw-r--r-- | common/ctor/driver.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 23d2af1..a83724c 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -58,16 +58,15 @@ main (int argc, char* argv[]) result r (db->query<person> (query::age < 30)); - assert (r.size () == 1); + assert (!r.empty ()); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - i.load (p); + result::iterator i (r.begin ()); + i.load (p); + assert (p.first_ == "Jane"); + assert (p.last_ == "Doe"); + assert (p.age_ == 29); - assert (p.first_ == "Jane"); - assert (p.last_ == "Doe"); - assert (p.age_ == 29); - } + assert (size (r) == 1); t.commit (); } |