diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-28 09:54:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-28 09:54:19 +0200 |
commit | e61fb61f6406db4d1b3b33eb72007ba22efb44bd (patch) | |
tree | 0dff61043ebda523eff7451b8f210d395ef4b9f0 /common/ctor | |
parent | 3de8e4843bc85f9fc6e63c1a4fea6b57ff0351b6 (diff) |
Recode tests to work with implementations lacking result::size()
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 (); } |