aboutsummaryrefslogtreecommitdiff
path: root/qt/oracle/basic/driver.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-11-30 16:05:52 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-30 16:16:43 +0200
commit72ad2f40da8268326bcbf4fc0d230860a8b05581 (patch)
tree8f7f4fd10b3658dbeeb4dbc84c9abfbfaa4da257 /qt/oracle/basic/driver.cxx
parent44cb5422ce125f356b9f6c87f4ef372d9d693fb1 (diff)
Add tests for QString NCHAR and NVARCHAR2 mapping
Diffstat (limited to 'qt/oracle/basic/driver.cxx')
-rw-r--r--qt/oracle/basic/driver.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx
index 1afb966..908f2b4 100644
--- a/qt/oracle/basic/driver.cxx
+++ b/qt/oracle/basic/driver.cxx
@@ -29,13 +29,21 @@ main (int argc, char* argv[])
{
auto_ptr<database> db (create_database (argc, argv));
- string long_str (20000, 'l');
+ string short_str (13, 's');
+ string medium_str (150, 'm');
+ string long_str (20000, 'v');
+ string unicode_str ("a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA");
object o;
- o.varchar = "John Doe";
- o.clob = QString::fromStdString (string (150, 'c'));
+ o.char_= QString::fromStdString (short_str);
+ o.varchar2 = QString::fromStdString (medium_str);
+ o.clob = QString::fromStdString (long_str);
+
+ o.nchar= QString::fromStdString (unicode_str);
+ o.nvarchar2 = QString::fromStdString (unicode_str);
o.nclob = QString::fromStdString (long_str);
+
o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8);
o.blob = QByteArray (long_str.c_str (),
static_cast<int> (long_str.size ()));
@@ -52,7 +60,7 @@ main (int argc, char* argv[])
//
{
transaction t (db->begin ());
- object* ol = db->load<object> (o.varchar);
+ object* ol = db->load<object> (o.varchar2);
t.commit ();
assert (*ol == o);