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
ef5b60b0
Verified
Commit
ef5b60b0
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: SELECT for GRPC API
parent
5fd69574
No related branches found
Branches containing commit
No related tags found
2 merge requests
!28
Release 0.2.2
,
!27
F grpc select
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/CMakeLists.txt
+1
-0
1 addition, 0 deletions
test/CMakeLists.txt
test/test_select.cpp
+47
-0
47 additions, 0 deletions
test/test_select.cpp
with
48 additions
and
0 deletions
test/CMakeLists.txt
+
1
−
0
View file @
ef5b60b0
...
...
@@ -30,6 +30,7 @@ set(test_cases
test_ccaosdb
test_issues
test_user
test_select
)
add_compile_definitions
(
BUILD_ACM
)
...
...
This diff is collapsed.
Click to expand it.
test/test_select.cpp
0 → 100644
+
47
−
0
View file @
ef5b60b0
/*
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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/connection.h"
// for Connection, ConnectionManager
#include
"caosdb/transaction.h"
// for Transaction, ResultTable
#include
<gtest/gtest-message.h>
// for Message
#include
<gtest/gtest-test-part.h>
// for SuiteApiResolver, TestFactoryImpl
#include
<gtest/gtest_pred_impl.h>
// for Test, TestInfo, EXPECT_EQ, TEST
#include
<memory>
// for allocator, unique_ptr, __shared_p...
//
namespace
caosdb
::
transaction
{
/*
* Test select query on empty database.
*/
TEST
(
test_transaction
,
test_select
)
{
const
auto
&
connection
=
caosdb
::
connection
::
ConnectionManager
::
GetDefaultConnection
();
auto
query_transaction
(
connection
->
CreateTransaction
());
query_transaction
->
Query
(
"SELECT name FROM ENTITY WITH id > 99"
);
query_transaction
->
Execute
();
EXPECT_EQ
(
query_transaction
->
GetResultTable
().
size
(),
0
);
EXPECT_EQ
(
query_transaction
->
GetResultTable
().
GetHeader
().
size
(),
1
);
for
(
const
auto
&
column
:
query_transaction
->
GetResultTable
().
GetHeader
())
{
EXPECT_EQ
(
column
.
GetName
(),
"name"
);
}
}
}
// namespace caosdb::transaction
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