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
a7ca7abd
Commit
a7ca7abd
authored
Jul 28, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unit test failures
parent
ab0eefbc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
11 deletions
+17
-11
libcaf_net/caf/net/basp/application.hpp
libcaf_net/caf/net/basp/application.hpp
+1
-2
libcaf_net/src/net/middleman.cpp
libcaf_net/src/net/middleman.cpp
+2
-1
libcaf_net/test/application.cpp
libcaf_net/test/application.cpp
+9
-3
libcaf_net/test/endpoint_manager.cpp
libcaf_net/test/endpoint_manager.cpp
+1
-1
libcaf_net/test/stream_socket.cpp
libcaf_net/test/stream_socket.cpp
+2
-2
libcaf_net/test/string_application.cpp
libcaf_net/test/string_application.cpp
+2
-2
No files found.
libcaf_net/caf/net/basp/application.hpp
View file @
a7ca7abd
...
@@ -82,9 +82,8 @@ public:
...
@@ -82,9 +82,8 @@ public:
system_
=
&
parent
.
system
();
system_
=
&
parent
.
system
();
executor_
.
system_ptr
(
system_
);
executor_
.
system_ptr
(
system_
);
executor_
.
proxy_registry_ptr
(
&
proxies_
);
executor_
.
proxy_registry_ptr
(
&
proxies_
);
// TODO: use `if constexpr` when switching to C++17.
// Allow unit tests to run the application without endpoint manager.
// Allow unit tests to run the application without endpoint manager.
if
(
!
std
::
is_base_of
<
test_tag
,
Parent
>::
value
)
if
constexpr
(
!
std
::
is_base_of
<
test_tag
,
Parent
>::
value
)
manager_
=
&
parent
.
manager
();
manager_
=
&
parent
.
manager
();
size_t
workers
;
size_t
workers
;
if
(
auto
workers_cfg
=
get_if
<
size_t
>
(
&
system_
->
config
(),
if
(
auto
workers_cfg
=
get_if
<
size_t
>
(
&
system_
->
config
(),
...
...
libcaf_net/src/net/middleman.cpp
View file @
a7ca7abd
...
@@ -105,7 +105,8 @@ void middleman::add_module_options(actor_system_config& cfg) {
...
@@ -105,7 +105,8 @@ void middleman::add_module_options(actor_system_config& cfg) {
"max. number of consecutive reads per broker"
)
"max. number of consecutive reads per broker"
)
.
add
<
bool
>
(
"manual-multiplexing"
,
.
add
<
bool
>
(
"manual-multiplexing"
,
"disables background activity of the multiplexer"
)
"disables background activity of the multiplexer"
)
.
add
<
size_t
>
(
"workers"
,
"number of deserialization workers"
);
.
add
<
size_t
>
(
"workers"
,
"number of deserialization workers"
)
.
add
<
std
::
string
>
(
"network-backend"
,
"legacy option"
);
}
}
expected
<
endpoint_manager_ptr
>
middleman
::
connect
(
const
uri
&
locator
)
{
expected
<
endpoint_manager_ptr
>
middleman
::
connect
(
const
uri
&
locator
)
{
...
...
libcaf_net/test/application.cpp
View file @
a7ca7abd
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "caf/net/basp/connection_state.hpp"
#include "caf/net/basp/connection_state.hpp"
#include "caf/net/basp/constants.hpp"
#include "caf/net/basp/constants.hpp"
#include "caf/net/basp/ec.hpp"
#include "caf/net/basp/ec.hpp"
#include "caf/net/middleman.hpp"
#include "caf/net/packet_writer.hpp"
#include "caf/net/packet_writer.hpp"
#include "caf/none.hpp"
#include "caf/none.hpp"
#include "caf/uri.hpp"
#include "caf/uri.hpp"
...
@@ -42,7 +43,13 @@ using namespace caf::net;
...
@@ -42,7 +43,13 @@ using namespace caf::net;
namespace
{
namespace
{
struct
fixture
:
test_coordinator_fixture
<>
,
struct
config
:
actor_system_config
{
config
()
{
net
::
middleman
::
add_module_options
(
*
this
);
}
};
struct
fixture
:
test_coordinator_fixture
<
config
>
,
proxy_registry
::
backend
,
proxy_registry
::
backend
,
basp
::
application
::
test_tag
,
basp
::
application
::
test_tag
,
public
packet_writer
{
public
packet_writer
{
...
@@ -242,8 +249,7 @@ CAF_TEST(actor message) {
...
@@ -242,8 +249,7 @@ CAF_TEST(actor message) {
MOCK
(
basp
::
message_type
::
actor_message
,
make_message_id
().
integer_value
(),
MOCK
(
basp
::
message_type
::
actor_message
,
make_message_id
().
integer_value
(),
mars
,
actor_id
{
42
},
self
->
id
(),
std
::
vector
<
strong_actor_ptr
>
{},
mars
,
actor_id
{
42
},
self
->
id
(),
std
::
vector
<
strong_actor_ptr
>
{},
make_message
(
"hello world!"
));
make_message
(
"hello world!"
));
allow
((
monitor_atom
,
strong_actor_ptr
),
expect
((
monitor_atom
,
strong_actor_ptr
),
from
(
_
).
to
(
self
));
from
(
_
).
to
(
self
).
with
(
monitor_atom_v
,
_
));
expect
((
std
::
string
),
from
(
_
).
to
(
self
).
with
(
"hello world!"
));
expect
((
std
::
string
),
from
(
_
).
to
(
self
).
with
(
"hello world!"
));
}
}
...
...
libcaf_net/test/endpoint_manager.cpp
View file @
a7ca7abd
...
@@ -164,7 +164,7 @@ CAF_TEST(send and receive) {
...
@@ -164,7 +164,7 @@ CAF_TEST(send and receive) {
auto
buf
=
std
::
make_shared
<
byte_buffer
>
();
auto
buf
=
std
::
make_shared
<
byte_buffer
>
();
auto
sockets
=
unbox
(
make_stream_socket_pair
());
auto
sockets
=
unbox
(
make_stream_socket_pair
());
CAF_CHECK_EQUAL
(
nonblocking
(
sockets
.
second
,
true
),
none
);
CAF_CHECK_EQUAL
(
nonblocking
(
sockets
.
second
,
true
),
none
);
CAF_CHECK_
EQUAL
(
read
(
sockets
.
second
,
read_buf
),
-
1
);
CAF_CHECK_
LESS
(
read
(
sockets
.
second
,
read_buf
),
0
);
CAF_CHECK
(
last_socket_error_is_temporary
());
CAF_CHECK
(
last_socket_error_is_temporary
());
auto
guard
=
detail
::
make_scope_guard
([
&
]
{
close
(
sockets
.
second
);
});
auto
guard
=
detail
::
make_scope_guard
([
&
]
{
close
(
sockets
.
second
);
});
auto
mgr
=
make_endpoint_manager
(
mpx
,
sys
,
auto
mgr
=
make_endpoint_manager
(
mpx
,
sys
,
...
...
libcaf_net/test/stream_socket.cpp
View file @
a7ca7abd
...
@@ -75,9 +75,9 @@ struct fixture : host_fixture {
...
@@ -75,9 +75,9 @@ struct fixture : host_fixture {
CAF_TEST_FIXTURE_SCOPE
(
network_socket_tests
,
fixture
)
CAF_TEST_FIXTURE_SCOPE
(
network_socket_tests
,
fixture
)
CAF_TEST
(
read
on
empty
sockets
)
{
CAF_TEST
(
read
on
empty
sockets
)
{
CAF_CHECK_
EQUAL
(
read
(
first
,
rd_buf
),
-
1
);
CAF_CHECK_
LESS
(
read
(
first
,
rd_buf
),
0
);
CAF_CHECK
(
last_socket_error_is_temporary
());
CAF_CHECK
(
last_socket_error_is_temporary
());
CAF_CHECK_
EQUAL
(
read
(
second
,
rd_buf
),
-
1
);
CAF_CHECK_
LESS
(
read
(
second
,
rd_buf
),
0
);
CAF_CHECK
(
last_socket_error_is_temporary
());
CAF_CHECK
(
last_socket_error_is_temporary
());
}
}
...
...
libcaf_net/test/string_application.cpp
View file @
a7ca7abd
...
@@ -208,8 +208,8 @@ CAF_TEST(receive) {
...
@@ -208,8 +208,8 @@ CAF_TEST(receive) {
auto
buf
=
std
::
make_shared
<
byte_buffer
>
();
auto
buf
=
std
::
make_shared
<
byte_buffer
>
();
auto
sockets
=
unbox
(
make_stream_socket_pair
());
auto
sockets
=
unbox
(
make_stream_socket_pair
());
CAF_CHECK_EQUAL
(
nonblocking
(
sockets
.
second
,
true
),
none
);
CAF_CHECK_EQUAL
(
nonblocking
(
sockets
.
second
,
true
),
none
);
CAF_CHECK_
EQUAL
(
read
(
sockets
.
second
,
read_buf
),
CAF_CHECK_
LESS
(
read
(
sockets
.
second
,
read_buf
),
0
);
sec
::
unavailable_or_would_block
);
CAF_CHECK
(
last_socket_error_is_temporary
()
);
CAF_MESSAGE
(
"adding both endpoint managers"
);
CAF_MESSAGE
(
"adding both endpoint managers"
);
auto
mgr1
=
make_endpoint_manager
(
auto
mgr1
=
make_endpoint_manager
(
mpx
,
sys
,
transport_type
{
sockets
.
first
,
application_type
{
buf
}});
mpx
,
sys
,
transport_type
{
sockets
.
first
,
application_type
{
buf
}});
...
...
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