Commit f45494de authored by Dominik Charousset's avatar Dominik Charousset

Fix uniform type unit test

parent 4c8a78f6
...@@ -25,8 +25,9 @@ namespace { ...@@ -25,8 +25,9 @@ namespace {
struct foo { struct foo {
int value; int value;
explicit foo(int val = 0) : value(val) {} explicit foo(int val = 0) : value(val) {
// nop
}
}; };
inline bool operator==(const foo& lhs, const foo& rhs) { inline bool operator==(const foo& lhs, const foo& rhs) {
...@@ -124,38 +125,41 @@ int main() { ...@@ -124,38 +125,41 @@ int main() {
// the uniform_type_info implementation is correct // the uniform_type_info implementation is correct
std::set<std::string> expected = { std::set<std::string> expected = {
// local types // local types
"foo", // <anonymous namespace>::foo "foo",
// primitive types // primitive types
"bool", "@i8", "@i16", "bool",
"@i32", "@i64", // signed integer names "@i8", "@i16", "@i32", "@i64", // signed integer names
"@u8", "@u16", "@u32", "@u8", "@u16", "@u32", "@u64", // unsigned integer names
"@u64", // unsigned integer names "@str", "@u16str", "@u32str", // strings
"@str", "@u16str", "@u32str", // strings "float", "double", "@ldouble", // floating points
"float", "double", "@ldouble", // floating points
// default announced types // default announced types
"@unit", // unit_t "@unit", // unit_t
"@actor", // actor "@actor", // actor
"@addr", // actor_addr "@addr", // actor_addr
"@atom", // atom_value "@atom", // atom_value
"@channel", // channel "@channel", // channel
"@charbuf", // vector<char> "@charbuf", // vector<char>
"@down", // down_msg "@down", // down_msg
"@duration", // duration "@duration", // duration
"@exit", // exit_msg "@exit", // exit_msg
"@group", // group "@group", // group
"@group_down", // group_down_msg "@group_down", // group_down_msg
"@message", // message "@message", // message
"@message_id", // message_id "@message_id", // message_id
"@node", // node_id "@node", // node_id
"@strmap", // map<string,string> "@strmap", // map<string,string>
"@timeout", // timeout_msg "@timeout", // timeout_msg
"@sync_exited", // sync_exited_msg "@sync_exited", // sync_exited_msg
"@sync_timeout", // sync_timeout_msg "@sync_timeout", // sync_timeout_msg
"@strvec" // vector<string> "@strvec", // vector<string>
"@strset" // set<string>
}; };
CAF_CHECKPOINT();
if (check_types(expected)) { if (check_types(expected)) {
CAF_CHECKPOINT();
// causes the middleman to create its singleton // causes the middleman to create its singleton
io::middleman::instance(); io::middleman::instance();
CAF_CHECKPOINT();
// ok, check whether middleman announces its types correctly // ok, check whether middleman announces its types correctly
check_types(append(expected, check_types(append(expected,
"caf::io::accept_handle", "caf::io::accept_handle",
...@@ -164,9 +168,12 @@ int main() { ...@@ -164,9 +168,12 @@ int main() {
"caf::io::connection_closed_msg", "caf::io::connection_closed_msg",
"caf::io::new_connection_msg", "caf::io::new_connection_msg",
"caf::io::new_data_msg")); "caf::io::new_data_msg"));
CAF_CHECKPOINT();
} }
// check whether enums can be announced as members // check whether enums can be announced as members
announce<test_enum>("test_enum"); announce<test_enum>("test_enum");
announce<test_struct>("test_struct", &test_struct::test_value); announce<test_struct>("test_struct", &test_struct::test_value);
CAF_CHECKPOINT();
shutdown();
return CAF_TEST_RESULT(); return CAF_TEST_RESULT();
} }
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