aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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());
}