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
be7f2dfc
Commit
be7f2dfc
authored
Sep 22, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve output of broker-related unit tests
parent
199aa7f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
unit_testing/test_broker.cpp
unit_testing/test_broker.cpp
+2
-3
unit_testing/test_remote_actor.cpp
unit_testing/test_remote_actor.cpp
+10
-4
No files found.
unit_testing/test_broker.cpp
View file @
be7f2dfc
...
@@ -155,9 +155,8 @@ void run_server(bool spawn_client, const char* bin_path) {
...
@@ -155,9 +155,8 @@ void run_server(bool spawn_client, const char* bin_path) {
done
=
true
;
done
=
true
;
}
}
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
if
(
!
spawn_client
)
{
cout
<<
"server is running on port "
<<
port
<<
endl
;
cout
<<
"server is running on port "
<<
port
<<
endl
;
if
(
spawn_client
)
{
}
else
{
ostringstream
oss
;
ostringstream
oss
;
oss
<<
bin_path
<<
" -c "
<<
port
<<
to_dev_null
;
oss
<<
bin_path
<<
" -c "
<<
port
<<
to_dev_null
;
thread
child
{[
&
oss
]
{
thread
child
{[
&
oss
]
{
...
...
unit_testing/test_remote_actor.cpp
View file @
be7f2dfc
...
@@ -346,14 +346,17 @@ void test_remote_actor(std::string app_path, bool run_remote_actor) {
...
@@ -346,14 +346,17 @@ void test_remote_actor(std::string app_path, bool run_remote_actor) {
CAF_LOGF_INFO
(
"running on port "
<<
port
);
CAF_LOGF_INFO
(
"running on port "
<<
port
);
// publish local groups as well
// publish local groups as well
auto
gport
=
at_some_port
(
port
+
1
,
publish_groups
);
auto
gport
=
at_some_port
(
port
+
1
,
publish_groups
);
// check whether accessing local actors via io::remote_actors works correctly,
// i.e., does not return a proxy instance
auto
serv2
=
io
::
remote_actor
(
"127.0.0.1"
,
port
);
auto
serv2
=
io
::
remote_actor
(
"127.0.0.1"
,
port
);
CAF_CHECK
(
serv2
!=
invalid_actor
&&
!
serv2
->
is_remote
());
CAF_CHECK
(
serv
==
serv2
);
CAF_CHECK
(
serv
==
serv2
);
CAF_TEST
(
test_remote_actor
);
CAF_TEST
(
test_remote_actor
);
thread
child
;
thread
child
;
ostringstream
oss
;
ostringstream
oss
;
oss
<<
app_path
<<
" -c "
<<
port
<<
" "
<<
port0
<<
" "
<<
gport
;
if
(
run_remote_actor
)
{
if
(
run_remote_actor
)
{
oss
<<
app_path
<<
" -c "
<<
port
<<
" "
<<
port0
oss
<<
to_dev_null
;
<<
" "
<<
gport
<<
to_dev_null
;
// execute client_part() in a separate process,
// execute client_part() in a separate process,
// connected via localhost socket
// connected via localhost socket
child
=
thread
([
&
oss
]()
{
child
=
thread
([
&
oss
]()
{
...
@@ -365,7 +368,7 @@ void test_remote_actor(std::string app_path, bool run_remote_actor) {
...
@@ -365,7 +368,7 @@ void test_remote_actor(std::string app_path, bool run_remote_actor) {
}
}
});
});
}
else
{
}
else
{
CAF_PRINT
(
"
actor published at port "
<<
port
);
CAF_PRINT
(
"
please run client: "
<<
oss
.
str
()
);
}
}
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
self
->
receive
(
self
->
receive
(
...
@@ -414,7 +417,10 @@ int main(int argc, char** argv) {
...
@@ -414,7 +417,10 @@ int main(int argc, char** argv) {
CAF_PRINT
(
"don't run remote actor (server mode)"
);
CAF_PRINT
(
"don't run remote actor (server mode)"
);
test_remote_actor
(
argv
[
0
],
false
);
test_remote_actor
(
argv
[
0
],
false
);
},
},
on
()
>>
[
&
]
{
test_remote_actor
(
argv
[
0
],
true
);
},
others
()
>>
[
&
]
{
on
()
>>
[
&
]
{
test_remote_actor
(
argv
[
0
],
true
);
},
others
()
>>
[
&
]
{
CAF_PRINTERR
(
"usage: "
<<
argv
[
0
]
<<
" [-s PORT|-c PORT1 PORT2 GROUP_PORT]"
);
CAF_PRINTERR
(
"usage: "
<<
argv
[
0
]
<<
" [-s PORT|-c PORT1 PORT2 GROUP_PORT]"
);
}
}
});
});
...
...
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