aboutsummaryrefslogtreecommitdiff
path: root/common/const
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-28 09:54:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-28 09:54:19 +0200
commite61fb61f6406db4d1b3b33eb72007ba22efb44bd (patch)
tree0dff61043ebda523eff7451b8f210d395ef4b9f0 /common/const
parent3de8e4843bc85f9fc6e63c1a4fea6b57ff0351b6 (diff)
Recode tests to work with implementations lacking result::size()
Diffstat (limited to 'common/const')
-rw-r--r--common/const/driver.cxx12
1 files changed, 8 insertions, 4 deletions
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<const obj1> (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<const obj2> (query2::id < 3));
+ assert (n1 == 2);
- assert (r2.size () == 2);
+ result2 r2 (db->query<const obj2> (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 ();
}