Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
a7b550b8
Commit
a7b550b8
authored
5 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Added unit-test cta_rdbms_StmtTest.insert_with_bindBool_true
parent
b62d8d24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rdbms/StmtTest.cpp
+40
-1
40 additions, 1 deletion
rdbms/StmtTest.cpp
with
40 additions
and
1 deletion
rdbms/StmtTest.cpp
+
40
−
1
View file @
a7b550b8
...
...
@@ -63,7 +63,8 @@ std::string cta_rdbms_StmtTest::getCreateStmtTestTableSql() {
"CREATE TABLE STMT_TEST("
"DOUBLE_COL FLOAT,"
"UINT64_COL NUMERIC(20, 0),"
"STRING_COL VARCHAR(100)"
"STRING_COL VARCHAR(100),"
"BOOL_COL CHAR(1)"
")"
;
switch
(
m_login
.
dbType
)
{
...
...
@@ -310,4 +311,42 @@ TEST_P(cta_rdbms_StmtTest, insert_with_bindString) {
}
}
TEST_P
(
cta_rdbms_StmtTest
,
insert_with_bindBool_true
)
{
using
namespace
cta
::
rdbms
;
const
bool
insertValue
=
true
;
// Insert a row into the test table
{
const
char
*
const
sql
=
"INSERT INTO STMT_TEST("
"BOOL_COL) "
"VALUES("
":BOOL_COL)"
;
auto
stmt
=
m_conn
.
createStmt
(
sql
);
stmt
.
bindBool
(
":BOOL_COL"
,
insertValue
);
stmt
.
executeNonQuery
();
}
// Select the row back from the table
{
const
char
*
const
sql
=
"SELECT "
"BOOL_COL AS BOOL_COL "
"FROM "
"STMT_TEST"
;
auto
stmt
=
m_conn
.
createStmt
(
sql
);
auto
rset
=
stmt
.
executeQuery
();
ASSERT_TRUE
(
rset
.
next
());
const
auto
selectValue
=
rset
.
columnOptionalBool
(
"BOOL_COL"
);
ASSERT_TRUE
((
bool
)
selectValue
);
ASSERT_EQ
(
insertValue
,
selectValue
.
value
());
ASSERT_FALSE
(
rset
.
next
());
}
}
}
// namespace unitTests
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment