diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/query/driver.cxx | 14 | ||||
-rw-r--r-- | common/query/test.std | 1 |
2 files changed, 15 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) { diff --git a/common/query/test.std b/common/query/test.std index 23f9029..58a2aa0 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -97,3 +97,4 @@ John Doe 30 married Jane Doe 29 married test 016 +test 017 |