From 1799af4802a3dff04d8d63095bbb749eb63099e6 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 25 Mar 2017 15:40:42 +0100 Subject: sqlitepp_test.cpp: Add a test case with non-ASCII characters --- src/sqlitepp_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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()); } -- cgit v1.2.3