Skip to content

Commit

Permalink
add test for #4108
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f committed Nov 27, 2023
1 parent 1cb332a commit 6ec7e91
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Data/SQLite/testsuite/src/SQLiteTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,26 @@ SQLiteTest::~SQLiteTest()
}


void SQLiteTest::testBind()
{
int f1 = -1;
Session session(Poco::Data::SQLite::Connector::KEY, "dummy.db");
session << "DROP TABLE IF EXISTS test", now;
session << "CREATE TABLE test (f1 INTEGER)", now;

Statement statement(session);
statement << "INSERT INTO test(f1) VALUES(?)";
statement.addBind(Poco::Data::Keywords::bind(1, "f1"));
statement.execute();
session << "SELECT f1 FROM test", into(f1), now;
assertTrue (f1 == 1);
statement.removeBind("f1");
statement.addBind(Poco::Data::Keywords::bind(2, "f1"));
statement.execute();
assertTrue (f1 == 2);
}


void SQLiteTest::testBinding()
{
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
Expand Down
1 change: 1 addition & 0 deletions Data/SQLite/testsuite/src/SQLiteTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SQLiteTest: public CppUnit::TestCase
SQLiteTest(const std::string& name);
~SQLiteTest();

void testBind();
void testBinding();
void testZeroRows();
void testSimpleAccess();
Expand Down

0 comments on commit 6ec7e91

Please sign in to comment.