aboutsummaryrefslogtreecommitdiff
path: root/common/inverse
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/inverse
parent3de8e4843bc85f9fc6e63c1a4fea6b57ff0351b6 (diff)
Recode tests to work with implementations lacking result::size()
Diffstat (limited to 'common/inverse')
-rw-r--r--common/inverse/driver.cxx9
1 files changed, 6 insertions, 3 deletions
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<obj2> (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<obj3> (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 ();
}