Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cppinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
caosdb-cppinttest
Commits
54da3f1d
Commit
54da3f1d
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add test for empty count query
parent
a96b0adf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!9
F consolidation
,
!7
ENH: Add test for extended extern C interface
Pipeline
#11865
failed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_ccaosdb.cpp
+32
-0
32 additions, 0 deletions
test/test_ccaosdb.cpp
with
32 additions
and
0 deletions
test/test_ccaosdb.cpp
+
32
−
0
View file @
54da3f1d
...
...
@@ -17,6 +17,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include
"caosdb/status_code.h"
// for StatusCode
#include
"ccaosdb.h"
// for caosdb_info_version_info, caosdb_...
#include
"gtest/gtest-message.h"
// for Message
#include
"gtest/gtest-test-part.h"
// for TestPartResult
...
...
@@ -40,3 +41,34 @@ TEST(test_ccaosdb, connection_ssl_authentication_success) {
EXPECT_EQ
(
minor
,
version_info
.
minor
);
EXPECT_STREQ
(
pre_release
,
version_info
.
pre_release
);
}
TEST
(
test_ccaosdb
,
test_count_query
)
{
caosdb_connection_connection
connection
;
int
return_code
(
caosdb_connection_connection_manager_get_default_connection
(
&
connection
));
EXPECT_EQ
(
return_code
,
0
);
caosdb_transaction_transaction
transaction
;
return_code
=
caosdb_connection_connection_create_transaction
(
&
connection
,
&
transaction
);
EXPECT_EQ
(
return_code
,
0
);
// COUNT query with an empty result
return_code
=
caosdb_transaction_transaction_query
(
&
transaction
,
"COUNT ENTITY WITH id='non-existing'"
);
EXPECT_EQ
(
return_code
,
caosdb
::
StatusCode
::
GO_ON
);
return_code
=
caosdb_transaction_transaction_execute
(
&
transaction
);
EXPECT_EQ
(
return_code
,
0
);
long
dummy
(
-
1
);
// NOLINT
long
*
count
=
&
dummy
;
// NOLINT
return_code
=
caosdb_transaction_transaction_get_count_result
(
&
transaction
,
count
);
EXPECT_EQ
(
return_code
,
0
);
EXPECT_EQ
(
*
count
,
0
);
return_code
=
caosdb_transaction_delete_transaction
(
&
transaction
);
EXPECT_EQ
(
return_code
,
0
);
}
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