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