Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
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-cpplib
Commits
58940216
Commit
58940216
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add HasWarnings
parent
cfa12f94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
ENH: Allow insertion and deletion of single entities
Pipeline
#11094
passed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#11096
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/caosdb/entity.h
+3
-0
3 additions, 0 deletions
include/caosdb/entity.h
test/test_entity.cpp
+2
-0
2 additions, 0 deletions
test/test_entity.cpp
with
5 additions
and
0 deletions
include/caosdb/entity.h
+
3
−
0
View file @
58940216
...
@@ -326,6 +326,9 @@ public:
...
@@ -326,6 +326,9 @@ public:
[[
nodiscard
]]
auto
GetWarnings
()
const
->
const
Messages
&
{
[[
nodiscard
]]
auto
GetWarnings
()
const
->
const
Messages
&
{
return
warnings
;
return
warnings
;
}
}
[[
nodiscard
]]
inline
auto
HasWarnings
()
const
->
bool
{
return
this
->
warnings
.
wrapped
->
size
()
>
0
;
}
[[
nodiscard
]]
auto
GetInfos
()
const
->
const
Messages
&
{
return
infos
;
}
[[
nodiscard
]]
auto
GetInfos
()
const
->
const
Messages
&
{
return
infos
;
}
inline
auto
ToString
()
const
->
const
std
::
string
{
inline
auto
ToString
()
const
->
const
std
::
string
{
...
...
This diff is collapsed.
Click to expand it.
test/test_entity.cpp
+
2
−
0
View file @
58940216
...
@@ -85,6 +85,7 @@ TEST(test_entity, test_from_id_response) { // NOLINT
...
@@ -85,6 +85,7 @@ TEST(test_entity, test_from_id_response) { // NOLINT
std
::
cout
<<
entity
.
ToString
()
<<
std
::
endl
;
std
::
cout
<<
entity
.
ToString
()
<<
std
::
endl
;
EXPECT_EQ
(
entity
.
GetId
(),
"entity_id"
);
EXPECT_EQ
(
entity
.
GetId
(),
"entity_id"
);
EXPECT_TRUE
(
entity
.
HasErrors
());
EXPECT_EQ
(
entity
.
GetErrors
().
Size
(),
1
);
EXPECT_EQ
(
entity
.
GetErrors
().
Size
(),
1
);
EXPECT_EQ
(
entity
.
GetErrors
().
At
(
0
).
GetDescription
(),
"error_desc"
);
EXPECT_EQ
(
entity
.
GetErrors
().
At
(
0
).
GetDescription
(),
"error_desc"
);
EXPECT_EQ
(
entity
.
GetErrors
().
At
(
0
).
GetCode
(),
EXPECT_EQ
(
entity
.
GetErrors
().
At
(
0
).
GetCode
(),
...
@@ -103,6 +104,7 @@ TEST(test_entity, test_from_id_response) { // NOLINT
...
@@ -103,6 +104,7 @@ TEST(test_entity, test_from_id_response) { // NOLINT
EXPECT_EQ
(
other_ent
.
GetId
(),
"other_entity_id"
);
EXPECT_EQ
(
other_ent
.
GetId
(),
"other_entity_id"
);
EXPECT_EQ
(
other_ent
.
GetWarnings
().
Size
(),
1
);
EXPECT_EQ
(
other_ent
.
GetWarnings
().
Size
(),
1
);
EXPECT_TRUE
(
other_ent
.
HasWarnings
());
EXPECT_EQ
(
other_ent
.
GetWarnings
().
At
(
0
).
GetDescription
(),
"warning_desc"
);
EXPECT_EQ
(
other_ent
.
GetWarnings
().
At
(
0
).
GetDescription
(),
"warning_desc"
);
EXPECT_EQ
(
other_ent
.
GetWarnings
().
At
(
0
).
GetCode
(),
EXPECT_EQ
(
other_ent
.
GetWarnings
().
At
(
0
).
GetCode
(),
MessageCode
::
ENTITY_HAS_NO_PROPERTIES
);
MessageCode
::
ENTITY_HAS_NO_PROPERTIES
);
...
...
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