Commit df71dafe authored by Marian Triebe's avatar Marian Triebe

Remove `shutdown` call from unit test framework

If necessary every unit test should call `shutdown` for itself.
parent d6f37fd4
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <string> #include <string>
#include "caf/all.hpp" #include "caf/all.hpp"
#include "caf/shutdown.hpp"
using namespace caf; using namespace caf;
...@@ -118,11 +119,15 @@ testee::behavior_type testee_impl(testee::pointer self) { ...@@ -118,11 +119,15 @@ testee::behavior_type testee_impl(testee::pointer self) {
} }
CAF_TEST(sync_send_atom_constants) { CAF_TEST(sync_send_atom_constants) {
scoped_actor self; {
auto tst = spawn_typed(testee_impl); scoped_actor self;
self->sync_send(tst, abc_atom::value).await( auto tst = spawn_typed(testee_impl);
[](int i) { self->sync_send(tst, abc_atom::value).await(
CAF_CHECK_EQUAL(i, 42); [](int i) {
} CAF_CHECK_EQUAL(i, 42);
); }
);
self->await_all_other_actors_done();
}
shutdown();
} }
...@@ -89,6 +89,7 @@ CAF_TEST(test_custom_exception_handler) { ...@@ -89,6 +89,7 @@ CAF_TEST(test_custom_exception_handler) {
} }
} }
); );
self->await_all_other_actors_done();
} }
shutdown(); shutdown();
} }
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "caf/all.hpp" #include "caf/on.hpp"
#include "caf/message.hpp"
#include "caf/message_builder.hpp"
#include "caf/message_handler.hpp"
using namespace caf; using namespace caf;
......
...@@ -120,5 +120,6 @@ CAF_TEST(test_fixed_stack_actor) { ...@@ -120,5 +120,6 @@ CAF_TEST(test_fixed_stack_actor) {
self->send_exit(st, exit_reason::user_shutdown); self->send_exit(st, exit_reason::user_shutdown);
self->await_all_other_actors_done(); self->await_all_other_actors_done();
} }
shutdown(); await_all_actors_done();
shutdown();
} }
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <algorithm> #include <algorithm>
#include "caf/all.hpp"
#include "caf/detail/limited_vector.hpp" #include "caf/detail/limited_vector.hpp"
using std::cout; using std::cout;
...@@ -75,5 +74,4 @@ CAF_TEST(limited_vector) { ...@@ -75,5 +74,4 @@ CAF_TEST(limited_vector) {
CAF_CHECK_EQUAL(vec7.size(), 5); CAF_CHECK_EQUAL(vec7.size(), 5);
CAF_CHECK((std::all_of(vec7.begin(), vec7.end(), CAF_CHECK((std::all_of(vec7.begin(), vec7.end(),
[](int i) { return i == 0; }))); [](int i) { return i == 0; })));
caf::shutdown();
} }
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <list> #include <list>
#include <cstddef> #include <cstddef>
#include "caf/shutdown.hpp"
#include "caf/ref_counted.hpp" #include "caf/ref_counted.hpp"
#include "caf/make_counted.hpp" #include "caf/make_counted.hpp"
#include "caf/intrusive_ptr.hpp" #include "caf/intrusive_ptr.hpp"
...@@ -162,5 +161,4 @@ CAF_TEST(full_test) { ...@@ -162,5 +161,4 @@ CAF_TEST(full_test) {
} }
CAF_CHECK_EQUAL(class0_instances, 0); CAF_CHECK_EQUAL(class0_instances, 0);
CAF_CHECK_EQUAL(class1_instances, 0); CAF_CHECK_EQUAL(class1_instances, 0);
shutdown();
} }
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
#include <functional> #include <functional>
#include "caf/all.hpp" #include "caf/on.hpp"
#include "caf/announce.hpp"
#include "caf/shutdown.hpp"
#include "caf/message_builder.hpp"
#include "caf/message_handler.hpp"
using namespace caf; using namespace caf;
using namespace std; using namespace std;
......
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
#define CAF_SUITE message #define CAF_SUITE message
#include "caf/test/unit_test.hpp" #include "caf/test/unit_test.hpp"
#include "caf/all.hpp" #include "caf/message.hpp"
#include "caf/message_builder.hpp"
using std::cout; using std::cout;
using std::endl; using std::endl;
...@@ -123,5 +124,4 @@ CAF_TEST(test_concat) { ...@@ -123,5 +124,4 @@ CAF_TEST(test_concat) {
get_atom::value, uint32_t{1}); get_atom::value, uint32_t{1});
CAF_CHECK_EQUAL(to_string(message::concat(m3, message{}, m1, m2)), CAF_CHECK_EQUAL(to_string(message::concat(m3, message{}, m1, m2)),
to_string(m4)); to_string(m4));
shutdown();
} }
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <string> #include <string>
#include "caf/optional.hpp" #include "caf/optional.hpp"
#include "caf/shutdown.hpp"
using namespace std; using namespace std;
using namespace caf; using namespace caf;
...@@ -70,5 +69,4 @@ CAF_TEST(test_optional) { ...@@ -70,5 +69,4 @@ CAF_TEST(test_optional) {
CAF_CHECK(!j.empty()); CAF_CHECK(!j.empty());
} }
} }
shutdown();
} }
...@@ -70,5 +70,6 @@ CAF_TEST(test_or_else) { ...@@ -70,5 +70,6 @@ CAF_TEST(test_or_else) {
}) })
); );
} }
await_all_actors_done();
shutdown(); shutdown();
} }
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include "caf/shutdown.hpp"
#include "caf/detail/ripemd_160.hpp" #include "caf/detail/ripemd_160.hpp"
using caf::detail::ripemd_160; using caf::detail::ripemd_160;
...@@ -63,5 +61,4 @@ CAF_TEST(test_ripemd_160) { ...@@ -63,5 +61,4 @@ CAF_TEST(test_ripemd_160) {
CAF_CHECK_EQUAL("9b752e45573d4b39f4dbd3323cab82bf63326bfb", CAF_CHECK_EQUAL("9b752e45573d4b39f4dbd3323cab82bf63326bfb",
str_hash("1234567890123456789012345678901234567890" str_hash("1234567890123456789012345678901234567890"
"1234567890123456789012345678901234567890")); "1234567890123456789012345678901234567890"));
caf::shutdown();
} }
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
#include "caf/actor.hpp"
namespace caf { namespace caf {
class message; class message;
namespace test { namespace test {
......
...@@ -26,11 +26,9 @@ ...@@ -26,11 +26,9 @@
#include <algorithm> #include <algorithm>
#include <condition_variable> #include <condition_variable>
#include "caf/shutdown.hpp"
#include "caf/message_builder.hpp" #include "caf/message_builder.hpp"
#include "caf/message_handler.hpp" #include "caf/message_handler.hpp"
#include "caf/string_algorithms.hpp" #include "caf/string_algorithms.hpp"
#include "caf/await_all_actors_done.hpp"
namespace caf { namespace caf {
namespace test { namespace test {
...@@ -613,8 +611,6 @@ int main(int argc, char** argv) { ...@@ -613,8 +611,6 @@ int main(int argc, char** argv) {
auto result = test::engine::run(colorize, log_file, verbosity_console, auto result = test::engine::run(colorize, log_file, verbosity_console,
verbosity_file, max_runtime, suites, verbosity_file, max_runtime, suites,
not_suites, tests, not_tests); not_suites, tests, not_tests);
await_all_actors_done();
shutdown();
return result ? 0 : 1; return result ? 0 : 1;
} }
......
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