[Pkg-owncloud-commits] [owncloud-client] 102/211: tests: Added unicode read an write testcase for ownsql.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 2f740fe4718751cb8e4d49d10cb2d44778cd54a8
Author: Klaas Freitag <freitag at owncloud.com>
Date: Thu Oct 16 21:21:47 2014 +0200
tests: Added unicode read an write testcase for ownsql.
---
test/testownsql.h | 35 ++++++++++++++++++++++++++++++-----
1 file changed, 30 insertions(+), 5 deletions(-)
diff --git a/test/testownsql.h b/test/testownsql.h
index f9dfaa6..c3f79f4 100644
--- a/test/testownsql.h
+++ b/test/testownsql.h
@@ -76,13 +76,13 @@ private slots:
void testInsert2() {
const char *sql = "INSERT INTO addresses (id, name, address, entered) VALUES "
- "(?0, ?1, ?2, ?3);";
+ "(?1, ?2, ?3, ?4);";
SqlQuery q(_db);
q.prepare(sql);
- q.bindValue(0, 2);
- q.bindValue(1, "Brucely Lafayette");
- q.bindValue(2, "Nurderway5, New York");
- q.bindValue(3, 1403101224);
+ q.bindValue(1, 2);
+ q.bindValue(2, "Brucely Lafayette");
+ q.bindValue(3, "Nurderway5, New York");
+ q.bindValue(4, 1403101224);
QVERIFY(q.exec());
}
@@ -123,6 +123,31 @@ private slots:
}
}
+ void testUnicode() {
+ const char *sql = "INSERT INTO addresses (id, name, address, entered) VALUES "
+ "(?1, ?2, ?3, ?4);";
+ SqlQuery q(_db);
+ q.prepare(sql);
+ q.bindValue(1, 3);
+ q.bindValue(2, QString::fromUtf8("пятницы"));
+ q.bindValue(3, QString::fromUtf8("проспект"));
+ q.bindValue(4, 1403002224);
+ QVERIFY(q.exec());
+ }
+
+ void testReadUnicode() {
+ const char *sql = "SELECT * FROM addresses WHERE id=3;";
+ SqlQuery q(_db);
+ q.prepare(sql);
+
+ if(q.next()) {
+ QString name = q.stringValue(1);
+ QString address = q.stringValue(2);
+ QVERIFY( name == QString::fromUtf8("пятницы") );
+ QVERIFY( address == QString::fromUtf8("проспект"));
+ }
+ }
+
private:
SqlDatabase _db;
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list