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
97fea3fd
Commit
97fea3fd
authored
Sep 07, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of multimap and of local bindings
parent
e3e459fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
libcaf_core/caf/inspector_access.hpp
libcaf_core/caf/inspector_access.hpp
+9
-9
libcaf_test/caf/test/unit_test.hpp
libcaf_test/caf/test/unit_test.hpp
+10
-11
No files found.
libcaf_core/caf/inspector_access.hpp
View file @
97fea3fd
...
...
@@ -26,16 +26,12 @@
#ifdef __has_include
# if __has_include(<optional>)
# include <optional>
# if __cpp_lib_optional >= 201606
# define CAF_HAS_STD_OPTIONAL
# endif
# endif
# if __has_include(<variant>)
# include <variant>
# if __cpp_lib_variant >= 201606
# define CAF_HAS_STD_VARIANT
# endif
# endif
#endif
#include "caf/allowed_unsafe_message_type.hpp"
...
...
@@ -167,11 +163,15 @@ bool load_value(Inspector& f, T& x, inspector_access_type::map) {
&&
load_value
(
f
,
val
)
//
&&
f
.
end_key_value_pair
()))
return
false
;
if
(
!
x
.
emplace
(
std
::
move
(
key
),
std
::
move
(
val
)).
second
)
{
// A multimap returns an iterator, a regular map returns a pair.
auto
emplace_result
=
x
.
emplace
(
std
::
move
(
key
),
std
::
move
(
val
));
if
constexpr
(
is_pair
<
decltype
(
emplace_result
)
>::
value
)
{
if
(
!
emplace_result
.
second
)
{
f
.
emplace_error
(
sec
::
runtime_error
,
"multiple key definitions"
);
return
false
;
}
}
}
return
f
.
end_associative_array
();
}
...
...
libcaf_test/caf/test/unit_test.hpp
View file @
97fea3fd
...
...
@@ -546,29 +546,28 @@ using caf_test_case_auto_fixture = caf::test::dummy_fixture;
} while (false)
#define CAF_CHECK(...) \
([
&] {
\
([
](bool expr_result) {
\
auto caf_check_res \
= ::caf::test::detail::check(::caf::test::engine::current_test(), \
__FILE__, __LINE__, #__VA_ARGS__, false, \
static_cast<bool>(__VA_ARGS__));
\
expr_result);
\
::caf::test::engine::last_check_file(__FILE__); \
::caf::test::engine::last_check_line(__LINE__); \
return caf_check_res; \
})()
})(
static_cast<bool>(__VA_ARGS__)
)
#define CAF_CHECK_FUNC(func, x_expr, y_expr) \
([
&] {
\
([
](auto&& x_val, auto&& y_val) {
\
func comparator; \
auto&& x_val___ = x_expr; \
auto&& y_val___ = y_expr; \
auto caf_check_res = ::caf::test::detail::check( \
::caf::test::engine::current_test(), __FILE__, __LINE__, \
auto caf_check_res \
= ::caf::test::detail::check(::caf::test::engine::current_test(), \
__FILE__, __LINE__, \
CAF_FUNC_EXPR(func, x_expr, y_expr), false, \
comparator(x_val___, y_val___), x_val___, y_val___);
\
comparator(x_val, y_val), x_val, y_val);
\
::caf::test::engine::last_check_file(__FILE__); \
::caf::test::engine::last_check_line(__LINE__); \
return caf_check_res; \
})()
})(
x_expr, y_expr
)
#define CAF_CHECK_FAIL(...) \
do { \
...
...
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