From e61fb61f6406db4d1b3b33eb72007ba22efb44bd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 09:54:19 +0200 Subject: Recode tests to work with implementations lacking result::size() --- common/inverse/driver.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'common/inverse') diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 1f018e7..c07b751 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -173,9 +173,10 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::o1::id == "obj1 1")); - assert (r.size () == 1); + assert (!r.empty ()); assert (r.begin ()->id == o2->id); assert (r.begin ()->o1->id == o1_1->id); + assert (size (r) == 1); t.commit (); } @@ -190,15 +191,17 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::o1::id == "obj1 1")); - - assert (r.size () == 2); + size_t n (0); for (result::iterator i (r.begin ()); i != r.end (); ++i) { assert (i->id == o3_1->id || i->id == o3_2->id); assert (i->o1->id == o1_1->id); + n++; } + assert (n == 2); + t.commit (); } -- cgit v1.1