aboutsummaryrefslogtreecommitdiff
path: root/common/query/driver.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-27 12:43:45 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-27 12:43:45 +0200
commit5586f85d5542b9552e59e555206e2e355f00864e (patch)
tree74db40a1380aa344ce18a4ebc5e007d10a923001 /common/query/driver.cxx
parente22a5890b984603a0b55a53b95bdf3c8378f9f23 (diff)
Simplify LOB column query tests
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r--common/query/driver.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx
index b94bed6..df631f4 100644
--- a/common/query/driver.cxx
+++ b/common/query/driver.cxx
@@ -444,26 +444,47 @@ main (int argc, char* argv[])
transaction t (db->begin ());
result r;
+ result::iterator i;
+ // Oracle does not support LOB comparisons.
+ //
#ifndef DATABASE_ORACLE
// ==
//
r = db->query<person> (query::public_key == key2);
- result::iterator i (r.begin ());
+ i = r.begin ();
assert (i != r.end ());
+
assert (i->public_key_ == key2);
+ assert (++i == r.end ());
#endif
// is_null
//
r = db->query<person> (query::public_key.is_null ());
- print (r);
+
+ i = r.begin ();
+ assert (i != r.end ());
+
+ assert (i->first_name_ == "Johansen" && i->last_name_ == "Johansen");
+ assert (++i == r.end ());
// is_not_null
//
r = db->query<person> (query::public_key.is_not_null ());
- print (r);
+
+ i = r.begin ();
+ assert (i != r.end ());
+
+ assert (i->first_name_ == "John" && i->last_name_ == "Doe");
+ assert (++i != r.end ());
+
+ assert (i->first_name_ == "Jane" && i->last_name_ == "Doe");
+ assert (++i != r.end ());
+
+ assert (i->first_name_ == "Joe" && i->last_name_ == "Dirt");
+ assert (++i == r.end ());
t.commit ();
}