Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
16dba433
Commit
16dba433
authored
Jul 28, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return the result from check functions
parent
7b96836a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
libcaf_test/caf/test/runnable.cpp
libcaf_test/caf/test/runnable.cpp
+4
-3
libcaf_test/caf/test/runnable.hpp
libcaf_test/caf/test/runnable.hpp
+4
-3
No files found.
libcaf_test/caf/test/runnable.cpp
View file @
16dba433
...
@@ -39,12 +39,13 @@ void runnable::run() {
...
@@ -39,12 +39,13 @@ void runnable::run() {
}
}
}
}
void
runnable
::
check
(
bool
value
,
const
detail
::
source_location
&
location
)
{
bool
runnable
::
check
(
bool
value
,
const
detail
::
source_location
&
location
)
{
if
(
value
)
{
if
(
value
)
{
reporter
::
instance
->
pass
(
location
);
reporter
::
instance
->
pass
(
location
);
return
;
}
else
{
}
reporter
::
instance
->
fail
(
"should be true"
,
location
);
reporter
::
instance
->
fail
(
"should be true"
,
location
);
}
return
value
;
}
}
block
&
runnable
::
current_block
()
{
block
&
runnable
::
current_block
()
{
...
...
libcaf_test/caf/test/runnable.hpp
View file @
16dba433
...
@@ -55,7 +55,7 @@ public:
...
@@ -55,7 +55,7 @@ public:
/// Checks whether `lhs` and `rhs` are equal.
/// Checks whether `lhs` and `rhs` are equal.
template
<
class
T0
,
class
T1
>
template
<
class
T0
,
class
T1
>
void
check_eq
(
const
T0
&
lhs
,
const
T1
&
rhs
,
bool
check_eq
(
const
T0
&
lhs
,
const
T1
&
rhs
,
const
detail
::
source_location
&
location
const
detail
::
source_location
&
location
=
detail
::
source_location
::
current
())
{
=
detail
::
source_location
::
current
())
{
if
(
std
::
is_integral_v
<
T0
>
&&
std
::
is_integral_v
<
T1
>
)
{
if
(
std
::
is_integral_v
<
T0
>
&&
std
::
is_integral_v
<
T1
>
)
{
...
@@ -64,13 +64,14 @@ public:
...
@@ -64,13 +64,14 @@ public:
}
}
if
(
lhs
==
rhs
)
{
if
(
lhs
==
rhs
)
{
reporter
::
instance
->
pass
(
location
);
reporter
::
instance
->
pass
(
location
);
return
;
return
true
;
}
}
reporter
::
instance
->
fail
(
binary_predicate
::
eq
,
stringify
(
lhs
),
reporter
::
instance
->
fail
(
binary_predicate
::
eq
,
stringify
(
lhs
),
stringify
(
rhs
),
location
);
stringify
(
rhs
),
location
);
return
false
;
}
}
void
check
(
bool
value
,
const
detail
::
source_location
&
location
bool
check
(
bool
value
,
const
detail
::
source_location
&
location
=
detail
::
source_location
::
current
());
=
detail
::
source_location
::
current
());
block
&
current_block
();
block
&
current_block
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment