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
Merge requests
!4
F multi retrieve
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
F multi retrieve
f-multi-retrieve
into
dev
Overview
0
Commits
9
Pipelines
7
Changes
1
Merged
Timm Fitschen
requested to merge
f-multi-retrieve
into
dev
3 years ago
Overview
0
Commits
9
Pipelines
7
Changes
1
Expand
Tests for
caosdb-cpplib!5 (merged)
0
0
Merge request reports
Viewing commit
b8e2679f
Prev
Next
Show latest version
1 file
+
28
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
b8e2679f
Merge branch 'f-insert' into f-multi-retrieve
· b8e2679f
Timm Fitschen
authored
3 years ago
test/test_transaction.cpp
+
28
−
0
Options
@@ -118,6 +118,10 @@ TEST(test_transaction, insert_delete) {
const
auto
&
new_entity
=
insert_result_set
.
GetEntity
();
EXPECT_FALSE
(
new_entity
.
GetId
().
empty
());
EXPECT_FALSE
(
new_entity
.
HasErrors
());
// Should have a warning since it has no properties
EXPECT_TRUE
(
new_entity
.
HasWarnings
());
EXPECT_EQ
(
new_entity
.
GetWarnings
().
Size
(),
1
);
EXPECT_EQ
(
new_entity
.
GetWarnings
().
At
(
0
).
GetCode
(),
MessageCode
::
ENTITY_HAS_NO_PROPERTIES
);
auto
delete_transaction
(
connection
->
CreateTransaction
());
@@ -166,4 +170,28 @@ TEST(test_transaction, test_multi_retrieve) {
MessageCode
::
ENTITY_DOES_NOT_EXIST
);
}
// TODO(fspreck) Insert an RT and a Record of this type, check
// whether this is reflected correctly in the inserted Record, then
// delete everything.
TEST
(
test_transaction
,
insert_delete_with_parent
)
{
const
auto
&
connection
=
caosdb
::
connection
::
ConnectionManager
::
GetDefaultConnection
();
auto
insert_transaction
(
connection
->
CreateTransaction
());
Entity
entity
;
entity
.
SetRole
(
"RecordType"
);
entity
.
SetName
(
"RT1"
);
insert_transaction
->
InsertEntity
(
&
entity
);
insert_transaction
->
ExecuteAsynchronously
();
auto
insert_status
=
insert_transaction
->
WaitForIt
();
ASSERT_TRUE
(
insert_status
.
IsTerminated
());
ASSERT_FALSE
(
insert_status
.
IsError
());
}
// TODO(fspreck) Insert a Record with a parent and a Property. Check
// for success and delete everything.
}
// namespace caosdb::transaction
Loading