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
1936edfd
Commit
1936edfd
authored
Oct 21, 2021
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
c1792e49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
CHANGELOG.md
CHANGELOG.md
+1
-1
libcaf_core/test/dsl.cpp
libcaf_core/test/dsl.cpp
+5
-3
No files found.
CHANGELOG.md
View file @
1936edfd
...
@@ -16,7 +16,7 @@ is based on [Keep a Changelog](https://keepachangelog.com).
...
@@ -16,7 +16,7 @@ is based on [Keep a Changelog](https://keepachangelog.com).
### Fixed
### Fixed
-
The DSL function
`run_until`
miscounted the number executed events, also
-
The DSL function
`run_until`
miscounted the number
of
executed events, also
causing
`run_once`
to report a wrong value. Both functions now return the
causing
`run_once`
to report a wrong value. Both functions now return the
correct result.
correct result.
-
Using
`allow(...).with(...)`
in unit tests without a matching message crashed
-
Using
`allow(...).with(...)`
in unit tests without a matching message crashed
...
...
libcaf_core/test/dsl.cpp
View file @
1936edfd
...
@@ -83,7 +83,7 @@ SCENARIO("unsuccessful checks increment the 'bad' counter") {
...
@@ -83,7 +83,7 @@ SCENARIO("unsuccessful checks increment the 'bad' counter") {
results
<<
CHECK_GE
(
1
,
2
);
results
<<
CHECK_GE
(
1
,
2
);
caf
::
test
::
logger
::
instance
().
levels
(
bk
);
caf
::
test
::
logger
::
instance
().
levels
(
bk
);
auto
failed_checks
=
this_test
->
bad
();
auto
failed_checks
=
this_test
->
bad
();
this_test
->
reset
();
// Prevent the unit test from actually failing.
this_test
->
reset
_bad
();
// Prevent the unit test from actually failing.
CHECK_EQ
(
failed_checks
,
7u
);
CHECK_EQ
(
failed_checks
,
7u
);
REQUIRE_EQ
(
results
.
values
.
size
(),
7u
);
REQUIRE_EQ
(
results
.
values
.
size
(),
7u
);
auto
is_false
=
[](
bool
x
)
{
return
!
x
;
};
auto
is_false
=
[](
bool
x
)
{
return
!
x
;
};
...
@@ -205,6 +205,8 @@ SCENARIO("tests may check for exceptions") {
...
@@ -205,6 +205,8 @@ SCENARIO("tests may check for exceptions") {
CHECK_THROWS_WITH
(
f
(),
"foo"
);
CHECK_THROWS_WITH
(
f
(),
"foo"
);
CHECK_THROWS_WITH_AS
(
f
(),
"foo"
,
std
::
runtime_error
);
CHECK_THROWS_WITH_AS
(
f
(),
"foo"
,
std
::
runtime_error
);
CHECK_NOTHROW
([]
{}());
CHECK_NOTHROW
([]
{}());
CHECK_EQ
(
this_test
->
good
(),
4u
);
CHECK_EQ
(
this_test
->
bad
(),
0u
);
}
}
}
}
WHEN
(
"using any CHECK_THROWS macro with a unexpected exception"
)
{
WHEN
(
"using any CHECK_THROWS macro with a unexpected exception"
)
{
...
@@ -261,8 +263,8 @@ SCENARIO("passing requirements increment the 'good' counter") {
...
@@ -261,8 +263,8 @@ SCENARIO("passing requirements increment the 'good' counter") {
SCENARIO
(
"failing requirements increment the 'bad' counter and throw"
)
{
SCENARIO
(
"failing requirements increment the 'bad' counter and throw"
)
{
GIVEN
(
"a unit test"
)
{
GIVEN
(
"a unit test"
)
{
auto
this_test
=
test
::
engine
::
current_test
();
auto
this_test
=
test
::
engine
::
current_test
();
WHEN
(
"using any REQUIRE macro with a
tru
e statement"
)
{
WHEN
(
"using any REQUIRE macro with a
fals
e statement"
)
{
THEN
(
"the '
good' counter increments by one per
requirement"
)
{
THEN
(
"the '
bad' counter increments by one per failed
requirement"
)
{
CHECK_FAILS
(
REQUIRE_EQ
(
1
,
2
));
CHECK_FAILS
(
REQUIRE_EQ
(
1
,
2
));
CHECK_FAILS
(
REQUIRE_EQ
(
this_test
->
good
(),
42u
));
CHECK_FAILS
(
REQUIRE_EQ
(
this_test
->
good
(),
42u
));
CHECK_FAILS
(
REQUIRE
(
false
));
CHECK_FAILS
(
REQUIRE
(
false
));
...
...
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