aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2017-03-25 15:40:42 +0100
committerRobin Krahl <me@robin-krahl.de>2017-03-25 15:40:42 +0100
commit1799af4802a3dff04d8d63095bbb749eb63099e6 (patch)
tree501d0d8ae9784f670fa08eb067e00600bb40ac97
parent760b3fee15e64622e47442eb93608e5eb138ff10 (diff)
downloadsqlitepp-1799af4802a3dff04d8d63095bbb749eb63099e6.tar.gz
sqlitepp-1799af4802a3dff04d8d63095bbb749eb63099e6.tar.bz2
sqlitepp_test.cpp: Add a test case with non-ASCII characters
-rw-r--r--src/sqlitepp_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sqlitepp_test.cpp b/src/sqlitepp_test.cpp
index dfa46d4..4752ed8 100644
--- a/src/sqlitepp_test.cpp
+++ b/src/sqlitepp_test.cpp
@@ -75,6 +75,14 @@ TEST(Database, insert) {
const int rowId2 = database.lastInsertRowId();
EXPECT_NE(0, rowId2);
EXPECT_NE(rowId1, rowId2);
+ statement->reset();
+ statement->bind(":id", 3);
+ statement->bind(2, "många äpplen");
+ statement->execute();
+ const int rowId3 = database.lastInsertRowId();
+ EXPECT_NE(0, rowId2);
+ EXPECT_NE(rowId1, rowId3);
+ EXPECT_NE(rowId2, rowId3);
}
TEST(Database, query) {
@@ -94,6 +102,12 @@ TEST(Database, query) {
value = resultSet.readString(1);
EXPECT_EQ(2, id);
EXPECT_EQ("other value", value);
+ EXPECT_TRUE(resultSet.next());
+ EXPECT_TRUE(resultSet.canRead());
+ id = resultSet.readInt(0);
+ value = resultSet.readString(1);
+ EXPECT_EQ(3, id);
+ EXPECT_EQ("många äpplen", value);
EXPECT_FALSE(resultSet.next());
EXPECT_FALSE(resultSet.canRead());
}