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/const/driver.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'common/const') diff --git a/common/const/driver.cxx b/common/const/driver.cxx index 10e3103..17c2edc 100644 --- a/common/const/driver.cxx +++ b/common/const/driver.cxx @@ -122,8 +122,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); result1 r1 (db->query (query1::id < 3)); - - assert (r1.size () == 2); + size_t n1 (0); for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) { @@ -134,11 +133,13 @@ main (int argc, char* argv[]) i.load (o); assert (p->id == o.id); delete p; + n1++; } - result2 r2 (db->query (query2::id < 3)); + assert (n1 == 2); - assert (r2.size () == 2); + result2 r2 (db->query (query2::id < 3)); + size_t n2 (0); for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) { @@ -148,8 +149,11 @@ main (int argc, char* argv[]) obj2 o (0); i.load (o); assert (p->id == o.id); + n2++; } + assert (n2 == 2); + t.commit (); } -- cgit v1.1