Commit 541e9065 authored by Dominik Charousset's avatar Dominik Charousset

removed legacy support for boost::thread

parent 98c3a5c6
......@@ -73,6 +73,18 @@ void pong(actor_ptr ping_actor) {
others() >> []() {
cout << __FILE__ << " line " << __LINE__ << ": "
<< 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);
}
);
}
......
......@@ -74,11 +74,11 @@ size_t test__pattern() {
static constexpr char const* arr1_as_string =
"{ 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 =
"{ arr[0] = @i32, arr[1] = anything, "
"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
pattern<atom_value, int, string> p0{util::wrapped<atom_value>{}};
......
#include <thread>
#include <string>
#include <sstream>
#include <iostream>
......@@ -6,7 +7,6 @@
#include "ping_pong.hpp"
#include "cppa/cppa.hpp"
#include "cppa/exception.hpp"
#include "cppa/detail/thread.hpp"
using std::cout;
using std::cerr;
......@@ -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";
// execute client_part() in a separate process,
// connected via localhost socket
detail::thread child([&oss]() {
std::thread child([&oss]() {
std::string cmdstr = oss.str();
if (system(cmdstr.c_str()) != 0) {
cerr << "FATAL: command \"" << cmdstr << "\" failed!" << endl;
......
......@@ -15,10 +15,12 @@
#include "test.hpp"
#include "cppa/atom.hpp"
#include "cppa/announce.hpp"
#include "cppa/serializer.hpp"
#include "cppa/deserializer.hpp"
#include "cppa/uniform_type_info.hpp"
#include "cppa/detail/types_array.hpp"
#include "cppa/util/callable_trait.hpp"
......@@ -106,5 +108,32 @@ size_t test__uniform_type() {
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;
}
......@@ -8,6 +8,9 @@
#include "cppa/util/fiber.hpp"
#include "cppa/detail/yield_interface.hpp"
#include <boost/context/all.hpp>
namespace cppa { namespace detail {
std::ostream& operator<<(std::ostream& o, yield_state ys) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment