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
541e9065
Commit
541e9065
authored
Jun 11, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed legacy support for boost::thread
parent
98c3a5c6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
4 deletions
+48
-4
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
+12
-0
unit_testing/test__pattern.cpp
unit_testing/test__pattern.cpp
+2
-2
unit_testing/test__remote_actor.cpp
unit_testing/test__remote_actor.cpp
+2
-2
unit_testing/test__uniform_type.cpp
unit_testing/test__uniform_type.cpp
+29
-0
unit_testing/test__yield_interface.cpp
unit_testing/test__yield_interface.cpp
+3
-0
No files found.
unit_testing/ping_pong.cpp
View file @
541e9065
...
@@ -73,6 +73,18 @@ void pong(actor_ptr ping_actor) {
...
@@ -73,6 +73,18 @@ void pong(actor_ptr ping_actor) {
others
()
>>
[]()
{
others
()
>>
[]()
{
cout
<<
__FILE__
<<
" line "
<<
__LINE__
<<
": "
cout
<<
__FILE__
<<
" line "
<<
__LINE__
<<
": "
<<
to_string
(
self
->
last_dequeued
())
<<
endl
;
<<
to_string
(
self
->
last_dequeued
())
<<
endl
;
cout
<<
"trap_exit? => "
<<
std
::
boolalpha
<<
self
->
trap_exit
()
<<
endl
;
auto
&
arr
=
detail
::
static_types_array
<
atom_value
,
std
::
uint32_t
>::
arr
;
auto
msg
=
self
->
last_dequeued
();
if
(
msg
.
size
()
==
2
)
{
cout
<<
"msg.type_at(0) == arr[0] => "
<<
(
msg
.
type_at
(
0
)
==
arr
[
0
])
<<
endl
;
cout
<<
"msg.type_at(1) == arr[1] => "
<<
(
msg
.
type_at
(
1
)
==
arr
[
1
])
<<
endl
;
cout
<<
"msg.type_at(1)->name() => "
<<
(
msg
.
type_at
(
1
)
->
name
())
<<
endl
;
cout
<<
"arr[1]->name() => "
<<
(
arr
[
1
]
->
name
())
<<
endl
;
cout
<<
std
::
hex
<<
"arr[1] => "
<<
arr
[
1
]
<<
endl
;
cout
<<
"msg.type_at(1) => "
<<
msg
.
type_at
(
1
)
<<
endl
;
}
self
->
quit
(
exit_reason
::
normal
);
}
}
);
);
}
}
...
...
unit_testing/test__pattern.cpp
View file @
541e9065
...
@@ -74,11 +74,11 @@ size_t test__pattern() {
...
@@ -74,11 +74,11 @@ size_t test__pattern() {
static
constexpr
char
const
*
arr1_as_string
=
static
constexpr
char
const
*
arr1_as_string
=
"{ arr[0] = @i32, arr[1] = anything, arr[2] = float }"
;
"{ arr[0] = @i32, arr[1] = anything, arr[2] = float }"
;
CPPA_CHECK_EQUAL
(
plot
(
arr1
),
arr1_as_string
);
CPPA_CHECK_EQUAL
(
arr1_as_string
,
plot
(
arr1
)
);
static
constexpr
char
const
*
arr2_as_string
=
static
constexpr
char
const
*
arr2_as_string
=
"{ arr[0] = @i32, arr[1] = anything, "
"{ arr[0] = @i32, arr[1] = anything, "
"arr[2] = std::pair<@i32,@i32> }"
;
"arr[2] = std::pair<@i32,@i32> }"
;
CPPA_CHECK_EQUAL
(
plot
(
arr2
),
arr2_as_string
);
CPPA_CHECK_EQUAL
(
arr2_as_string
,
plot
(
arr2
)
);
// some pattern objects to play with
// some pattern objects to play with
pattern
<
atom_value
,
int
,
string
>
p0
{
util
::
wrapped
<
atom_value
>
{}};
pattern
<
atom_value
,
int
,
string
>
p0
{
util
::
wrapped
<
atom_value
>
{}};
...
...
unit_testing/test__remote_actor.cpp
View file @
541e9065
#include <thread>
#include <string>
#include <string>
#include <sstream>
#include <sstream>
#include <iostream>
#include <iostream>
...
@@ -6,7 +7,6 @@
...
@@ -6,7 +7,6 @@
#include "ping_pong.hpp"
#include "ping_pong.hpp"
#include "cppa/cppa.hpp"
#include "cppa/cppa.hpp"
#include "cppa/exception.hpp"
#include "cppa/exception.hpp"
#include "cppa/detail/thread.hpp"
using
std
::
cout
;
using
std
::
cout
;
using
std
::
cerr
;
using
std
::
cerr
;
...
@@ -57,7 +57,7 @@ size_t test__remote_actor(char const* app_path, bool is_client,
...
@@ -57,7 +57,7 @@ size_t test__remote_actor(char const* app_path, bool is_client,
oss
<<
app_path
<<
" run=remote_actor port="
<<
port
;
// << " &>/dev/null";
oss
<<
app_path
<<
" run=remote_actor port="
<<
port
;
// << " &>/dev/null";
// execute client_part() in a separate process,
// execute client_part() in a separate process,
// connected via localhost socket
// connected via localhost socket
detail
::
thread
child
([
&
oss
]()
{
std
::
thread
child
([
&
oss
]()
{
std
::
string
cmdstr
=
oss
.
str
();
std
::
string
cmdstr
=
oss
.
str
();
if
(
system
(
cmdstr
.
c_str
())
!=
0
)
{
if
(
system
(
cmdstr
.
c_str
())
!=
0
)
{
cerr
<<
"FATAL: command
\"
"
<<
cmdstr
<<
"
\"
failed!"
<<
endl
;
cerr
<<
"FATAL: command
\"
"
<<
cmdstr
<<
"
\"
failed!"
<<
endl
;
...
...
unit_testing/test__uniform_type.cpp
View file @
541e9065
...
@@ -15,10 +15,12 @@
...
@@ -15,10 +15,12 @@
#include "test.hpp"
#include "test.hpp"
#include "cppa/atom.hpp"
#include "cppa/announce.hpp"
#include "cppa/announce.hpp"
#include "cppa/serializer.hpp"
#include "cppa/serializer.hpp"
#include "cppa/deserializer.hpp"
#include "cppa/deserializer.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/detail/types_array.hpp"
#include "cppa/util/callable_trait.hpp"
#include "cppa/util/callable_trait.hpp"
...
@@ -106,5 +108,32 @@ size_t test__uniform_type() {
...
@@ -106,5 +108,32 @@ size_t test__uniform_type() {
cout
<<
" - "
<<
tname
<<
endl
;
cout
<<
" - "
<<
tname
<<
endl
;
}
}
}
}
auto
&
arr0
=
detail
::
static_types_array
<
atom_value
,
std
::
uint32_t
>::
arr
;
CPPA_CHECK
(
arr0
[
0
]
==
uniform_typeid
<
atom_value
>
());
CPPA_CHECK
(
arr0
[
0
]
==
uniform_type_info
::
from
(
"@atom"
));
CPPA_CHECK
(
arr0
[
1
]
==
uniform_typeid
<
std
::
uint32_t
>
());
CPPA_CHECK
(
arr0
[
1
]
==
uniform_type_info
::
from
(
"@u32"
));
CPPA_CHECK
(
uniform_type_info
::
from
(
"@u32"
)
==
uniform_typeid
<
std
::
uint32_t
>
());
auto
&
arr1
=
detail
::
static_types_array
<
std
::
string
,
std
::
int8_t
>::
arr
;
CPPA_CHECK
(
arr1
[
0
]
==
uniform_typeid
<
std
::
string
>
());
CPPA_CHECK
(
arr1
[
0
]
==
uniform_type_info
::
from
(
"@str"
));
CPPA_CHECK
(
arr1
[
1
]
==
uniform_typeid
<
std
::
int8_t
>
());
CPPA_CHECK
(
arr1
[
1
]
==
uniform_type_info
::
from
(
"@i8"
));
auto
&
arr2
=
detail
::
static_types_array
<
std
::
uint8_t
,
std
::
int8_t
>::
arr
;
CPPA_CHECK
(
arr2
[
0
]
==
uniform_typeid
<
std
::
uint8_t
>
());
CPPA_CHECK
(
arr2
[
0
]
==
uniform_type_info
::
from
(
"@u8"
));
CPPA_CHECK
(
arr2
[
1
]
==
uniform_typeid
<
std
::
int8_t
>
());
CPPA_CHECK
(
arr2
[
1
]
==
uniform_type_info
::
from
(
"@i8"
));
auto
&
arr3
=
detail
::
static_types_array
<
atom_value
,
std
::
uint16_t
>::
arr
;
CPPA_CHECK
(
arr3
[
0
]
==
uniform_typeid
<
atom_value
>
());
CPPA_CHECK
(
arr3
[
0
]
==
uniform_type_info
::
from
(
"@atom"
));
CPPA_CHECK
(
arr3
[
1
]
==
uniform_typeid
<
std
::
uint16_t
>
());
CPPA_CHECK
(
arr3
[
1
]
==
uniform_type_info
::
from
(
"@u16"
));
CPPA_CHECK
(
uniform_type_info
::
from
(
"@u16"
)
==
uniform_typeid
<
std
::
uint16_t
>
());
return
CPPA_TEST_RESULT
;
return
CPPA_TEST_RESULT
;
}
}
unit_testing/test__yield_interface.cpp
View file @
541e9065
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
#include "cppa/util/fiber.hpp"
#include "cppa/util/fiber.hpp"
#include "cppa/detail/yield_interface.hpp"
#include "cppa/detail/yield_interface.hpp"
#include <boost/context/all.hpp>
namespace
cppa
{
namespace
detail
{
namespace
cppa
{
namespace
detail
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
yield_state
ys
)
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
yield_state
ys
)
{
...
...
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