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
04f76fbb
Commit
04f76fbb
authored
Feb 26, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shadowing warnings and use shutdown in tests
parent
19abf110
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
44 additions
and
36 deletions
+44
-36
libcaf_core/caf/detail/logging.hpp
libcaf_core/caf/detail/logging.hpp
+11
-7
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+1
-1
unit_testing/test_actor_lifetime.cpp
unit_testing/test_actor_lifetime.cpp
+1
-0
unit_testing/test_atom.cpp
unit_testing/test_atom.cpp
+1
-0
unit_testing/test_constructor_attach.cpp
unit_testing/test_constructor_attach.cpp
+1
-0
unit_testing/test_custom_exception_handler.cpp
unit_testing/test_custom_exception_handler.cpp
+1
-0
unit_testing/test_either.cpp
unit_testing/test_either.cpp
+1
-0
unit_testing/test_fixed_stack_actor.cpp
unit_testing/test_fixed_stack_actor.cpp
+1
-0
unit_testing/test_fixed_vector.cpp
unit_testing/test_fixed_vector.cpp
+1
-0
unit_testing/test_intrusive_containers.cpp
unit_testing/test_intrusive_containers.cpp
+1
-0
unit_testing/test_intrusive_ptr.cpp
unit_testing/test_intrusive_ptr.cpp
+1
-0
unit_testing/test_match.cpp
unit_testing/test_match.cpp
+1
-0
unit_testing/test_message.cpp
unit_testing/test_message.cpp
+1
-0
unit_testing/test_metaprogramming.cpp
unit_testing/test_metaprogramming.cpp
+1
-1
unit_testing/test_optional.cpp
unit_testing/test_optional.cpp
+1
-0
unit_testing/test_or_else.cpp
unit_testing/test_or_else.cpp
+1
-0
unit_testing/test_ripemd_160.cpp
unit_testing/test_ripemd_160.cpp
+12
-26
unit_testing/test_serial_reply.cpp
unit_testing/test_serial_reply.cpp
+1
-0
unit_testing/test_serialization.cpp
unit_testing/test_serialization.cpp
+1
-0
unit_testing/test_simple_reply_response.cpp
unit_testing/test_simple_reply_response.cpp
+1
-0
unit_testing/test_sync_send.cpp
unit_testing/test_sync_send.cpp
+1
-0
unit_testing/test_typed_spawn.cpp
unit_testing/test_typed_spawn.cpp
+1
-1
unit_testing/test_variant.cpp
unit_testing/test_variant.cpp
+1
-0
No files found.
libcaf_core/caf/detail/logging.hpp
View file @
04f76fbb
...
...
@@ -146,6 +146,10 @@ oss_wr operator<<(oss_wr&& lhs, T rhs) {
#define CAF_LVL_NAME3() "DEBUG"
#define CAF_LVL_NAME4() "TRACE"
#define CAF_CONCAT_(LHS, RHS) LHS ## RHS
#define CAF_CONCAT(LHS, RHS) CAF_CONCAT_(LHS, RHS)
#define CAF_UNIFYN(NAME) CAF_CONCAT(NAME, __LINE__)
#define CAF_PRINT_ERROR_IMPL(lvlname, classname, funname, message) \
{ \
std::cerr << "[" << lvlname << "] " << classname << "::" << funname \
...
...
@@ -171,14 +175,14 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
<< std::boolalpha \
<< message).str())
#define CAF_PUSH_AID(aid_arg) \
auto
prev_aid_in_scope
\
auto
CAF_UNIFYN(caf_aid_tmp)
\
= caf::detail::singletons::get_logger()->set_aid(aid_arg); \
auto
aid_pop_sg = caf::detail::make_scope_guard([=] {
\
caf::detail::singletons::get_logger()->set_aid(
prev_aid_in_scope);
\
auto
CAF_UNIFYN(aid_aid_tmp_guard) = caf::detail::make_scope_guard([=] {
\
caf::detail::singletons::get_logger()->set_aid(
CAF_UNIFYN(caf_aid_tmp));
\
})
#define CAF_PUSH_AID_FROM_PTR(some_ptr) \
auto
aid_ptr_argument = some_ptr;
\
CAF_PUSH_AID(
aid_ptr_argument ? aid_ptr_argument
->id() : 0)
auto
CAF_UNIFYN(caf_aid_ptr) = some_ptr;
\
CAF_PUSH_AID(
CAF_UNIFYN(caf_aid_ptr) ? CAF_UNIFYN(caf_aid_ptr)
->id() : 0)
#define CAF_SET_AID(aid_arg) \
caf::detail::singletons::get_logger()->set_aid(aid_arg)
#endif
...
...
@@ -204,7 +208,7 @@ inline caf::actor_id caf_set_aid_dummy() { return 0; }
#define CAF_PRINT4(arg0, arg1, arg2, arg3)
#else
#define CAF_PRINT4(lvlname, classname, funname, msg) \
caf::detail::logging::trace_helper
caf_log_trace_temporary_object {
\
caf::detail::logging::trace_helper
CAF_UNIFYN(caf_log_trace_) {
\
classname, funname, __FILE__, __LINE__, \
(caf::detail::oss_wr{} << msg).str() \
}
...
...
libcaf_io/src/middleman.cpp
View file @
04f76fbb
...
...
@@ -299,7 +299,7 @@ class middleman_actor_impl : public middleman_actor_base::base {
}
template
<
class
F
>
bool
finalize_request
(
map_type
&
storage
,
u
int64_t
req_id
,
F
fun
)
{
bool
finalize_request
(
map_type
&
storage
,
int64_t
req_id
,
F
fun
)
{
auto
i
=
storage
.
find
(
req_id
);
if
(
i
==
storage
.
end
())
{
return
false
;
...
...
unit_testing/test_actor_lifetime.cpp
View file @
04f76fbb
...
...
@@ -109,5 +109,6 @@ void test_actor_lifetime() {
int
main
()
{
CAF_TEST
(
test_actor_lifetime
);
test_actor_lifetime
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_atom.cpp
View file @
04f76fbb
...
...
@@ -115,5 +115,6 @@ int main() {
others
>>
CAF_UNEXPECTED_MSG_CB_REF
(
self
)
);
test_typed_atom_interface
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_constructor_attach.cpp
View file @
04f76fbb
...
...
@@ -56,5 +56,6 @@ void test_constructor_attach() {
int
main
()
{
CAF_TEST
(
test_constructor_attach
);
test_constructor_attach
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_custom_exception_handler.cpp
View file @
04f76fbb
...
...
@@ -73,5 +73,6 @@ void test_custom_exception_handler() {
int
main
()
{
CAF_TEST
(
test_custom_exception_handler
);
test_custom_exception_handler
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_either.cpp
View file @
04f76fbb
...
...
@@ -59,5 +59,6 @@ void test_either() {
int
main
()
{
CAF_TEST
(
test_either
);
test_either
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_fixed_stack_actor.cpp
View file @
04f76fbb
...
...
@@ -104,5 +104,6 @@ void test_fixed_stack_actor() {
int
main
()
{
CAF_TEST
(
test_fixed_stack_actor
);
test_fixed_stack_actor
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_fixed_vector.cpp
View file @
04f76fbb
...
...
@@ -57,5 +57,6 @@ int main() {
CAF_CHECK_EQUAL
(
vec7
.
size
(),
5
);
CAF_CHECK
((
std
::
all_of
(
vec7
.
begin
(),
vec7
.
end
(),
[](
int
i
)
{
return
i
==
0
;
})));
caf
::
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_intrusive_containers.cpp
View file @
04f76fbb
...
...
@@ -206,5 +206,6 @@ int main() {
test_recursive_invoke_from_cache
<
policy
::
prioritizing
>
();
CAF_PRINT
(
"test_recursive_invoke_from_cache<policy::not_prioritizing>"
);
test_recursive_invoke_from_cache
<
policy
::
not_prioritizing
>
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_intrusive_ptr.cpp
View file @
04f76fbb
...
...
@@ -123,5 +123,6 @@ int main() {
}
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_match.cpp
View file @
04f76fbb
...
...
@@ -179,5 +179,6 @@ int main() {
test_atoms
();
test_custom_projections
();
test_arg_match
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_message.cpp
View file @
04f76fbb
...
...
@@ -116,5 +116,6 @@ int main() {
test_extract3
();
test_extract_opts
();
test_type_token
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_metaprogramming.cpp
View file @
04f76fbb
...
...
@@ -75,6 +75,6 @@ int main() {
CAF_CHECK
((
tl_is_strict_subset
<
list_a
,
list_a
>::
value
));
CAF_CHECK
((
tl_is_strict_subset
<
list_b
,
list_b
>::
value
));
}
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_optional.cpp
View file @
04f76fbb
...
...
@@ -49,6 +49,7 @@ int main() {
CAF_CHECK
(
!
j
.
empty
());
}
}
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_or_else.cpp
View file @
04f76fbb
...
...
@@ -53,5 +53,6 @@ void test_or_else() {
int
main
()
{
CAF_TEST
(
test_or_else
);
test_or_else
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_ripemd_160.cpp
View file @
04f76fbb
...
...
@@ -13,11 +13,9 @@ std::string str_hash(const std::string& what) {
std
::
array
<
uint8_t
,
20
>
hash
;
ripemd_160
(
hash
,
what
);
std
::
ostringstream
oss
;
oss
<<
std
::
hex
;
oss
<<
std
::
setfill
(
'0'
)
<<
std
::
hex
;
for
(
auto
i
:
hash
)
{
oss
.
width
(
2
);
oss
.
fill
(
'0'
);
oss
<<
static_cast
<
uint32_t
>
(
i
);
oss
<<
std
::
setw
(
2
)
<<
static_cast
<
int
>
(
i
);
}
return
oss
.
str
();
}
...
...
@@ -28,34 +26,22 @@ std::string str_hash(const std::string& what) {
// http://homes.esat.kuleuven.be/~bosselae/ripemd160.html
int
main
()
{
CAF_TEST
(
test_ripemd_160
);
CAF_CHECK_EQUAL
(
"9c1185a5c5e9fc54612808977ee8f548b2258d31"
,
str_hash
(
""
));
CAF_CHECK_EQUAL
(
"0bdc9d2d256b3ee9daae347be6f4dc835a467ffe"
,
str_hash
(
"a"
));
CAF_CHECK_EQUAL
(
"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"
,
str_hash
(
"abc"
));
CAF_CHECK_EQUAL
(
"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"
,
str_hash
(
"abc"
));
CAF_CHECK_EQUAL
(
"5d0689ef49d2fae572b881b123a85ffa21595f36"
,
str_hash
(
"message digest"
));
CAF_CHECK_EQUAL
(
"f71c27109c692c1b56bbdceb5b9d2865b3708dbc"
,
str_hash
(
"abcdefghijklmnopqrstuvwxyz"
));
CAF_CHECK_EQUAL
(
"12a053384a9c0c88e405a06c27dcf49ada62eb2b"
,
str_hash
(
"abcdbcdecdefdefgefghfghighij"
str_hash
(
"abcdbcdecdefdefgefghfghighij"
"hijkijkljklmklmnlmnomnopnopq"
));
CAF_CHECK_EQUAL
(
"b0e20b6e3116640286ed3a87a5713079b21f5189"
,
str_hash
(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
str_hash
(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcde"
"fghijklmnopqrstuvwxyz0123456789"
));
CAF_CHECK_EQUAL
(
"9b752e45573d4b39f4dbd3323cab82bf63326bfb"
,
str_hash
(
"1234567890123456789012345678901234567890"
str_hash
(
"1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890"
));
caf
::
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_serial_reply.cpp
View file @
04f76fbb
...
...
@@ -73,5 +73,6 @@ void test_serial_reply() {
int
main
()
{
CAF_TEST
(
test_serial_reply
);
test_serial_reply
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_serialization.cpp
View file @
04f76fbb
...
...
@@ -307,5 +307,6 @@ int main() {
}
catch (std::exception& e) { CAF_FAILURE(to_verbose_string(e)); }
*/
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_simple_reply_response.cpp
View file @
04f76fbb
...
...
@@ -27,5 +27,6 @@ void test_simple_reply_response() {
int
main
()
{
CAF_TEST
(
test_simple_reply_response
);
test_simple_reply_response
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_sync_send.cpp
View file @
04f76fbb
...
...
@@ -406,5 +406,6 @@ int main() {
test_sync_send
();
await_all_actors_done
();
CAF_CHECKPOINT
();
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_typed_spawn.cpp
View file @
04f76fbb
...
...
@@ -345,6 +345,6 @@ int main() {
test_sending_typed_actors_and_down_msg
();
await_all_actors_done
();
CAF_CHECKPOINT
();
// call it a day
shutdown
();
return
CAF_TEST_RESULT
();
}
unit_testing/test_variant.cpp
View file @
04f76fbb
...
...
@@ -25,5 +25,6 @@ int main() {
CAF_CHECK_EQUAL
(
apply_visitor
(
tv
,
v2
),
"42"
);
v2
=
0.2
f
;
CAF_CHECK_EQUAL
(
apply_visitor
(
tv
,
v2
),
std
::
to_string
(
0.2
f
));
shutdown
();
return
CAF_TEST_RESULT
();
}
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