diff options
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r-- | common/query/driver.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 45392b8..e019fe5 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -493,6 +493,20 @@ main (int argc, char* argv[]) t.commit (); } + + // Test iterator::id(). + // + cout << "test 017" << endl; + { + transaction t (db->begin ()); + result r (db->query<person> (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i.id () == 3); + + t.commit (); + } } catch (const odb::exception& e) { |