diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-09 20:19:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-09 20:19:17 +0200 |
commit | 5aee82f8d634739d8b1af602d804e76d962a2d56 (patch) | |
tree | ecf8314f264ba8d1230ebc788170d629a98c7ee4 /common/blob | |
parent | df9de141e37fdec17c33d56cb0f21f76a4867239 (diff) |
Make sure we can use same type as both container and simple value
Diffstat (limited to 'common/blob')
-rw-r--r-- | common/blob/driver.cxx | 3 | ||||
-rw-r--r-- | common/blob/test.hxx | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 0c58deb..f123577 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -48,6 +48,9 @@ main (int argc, char* argv[]) o.vuc.assign (udata, udata + sizeof (data)); memcpy (o.c, data, sizeof (data)); memcpy (o.uc, udata, sizeof (data)); + o.cont.push_back (1); + o.cont.push_back (2); + o.cont.push_back (3); { transaction t (db->begin ()); diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 5fb501e..b1b7cf5 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -39,6 +39,10 @@ struct object #pragma db type(BLOB_TYPE) unsigned char uc[1024]; + + // Make sure we can still use std::vector<char> as a container. + // + std::vector<unsigned char> cont; }; inline bool @@ -49,7 +53,8 @@ operator== (const object& x, const object& y) x.vc == y.vc && x.vuc == y.vuc && std::memcmp (x.c, y.c, sizeof (x.c)) == 0 && - std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0; + std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 && + x.cont == y.cont; } #endif // TEST_HXX |