Commit 0a8ab78e authored by Dominik Charousset's avatar Dominik Charousset

Fix UB in unit tests from messed up fixtures

parent 11298e99
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
using namespace std; using namespace std;
using namespace caf; using namespace caf;
namespace {
template <class... Ts> template <class... Ts>
void print(const char* format, Ts... xs) { void print(const char* format, Ts... xs) {
char buf[200]; char buf[200];
...@@ -69,6 +71,8 @@ struct fixture { ...@@ -69,6 +71,8 @@ struct fixture {
} }
}; };
} // namespace <anonymous>
CAF_TEST_FIXTURE_SCOPE(inbound_path_tests, fixture) CAF_TEST_FIXTURE_SCOPE(inbound_path_tests, fixture)
CAF_TEST(default_constructed) { CAF_TEST(default_constructed) {
......
...@@ -28,21 +28,19 @@ ...@@ -28,21 +28,19 @@
using namespace caf; using namespace caf;
using caf::io::network::receive_buffer; using caf::io::network::receive_buffer;
struct fixture { namespace {
receive_buffer a; struct fixture {
receive_buffer b; receive_buffer a;
std::vector<char> vec; receive_buffer b;
std::vector<char> vec;
fixture() fixture() : b(1024ul), vec{'h', 'a', 'l', 'l', 'o'} {
: a{},
b{1024ul},
vec{'h', 'a', 'l', 'l', 'o'} {
// nop // nop
} }
}; };
} // namespace <anonymous>
CAF_TEST_FIXTURE_SCOPE(receive_buffer_tests, fixture) CAF_TEST_FIXTURE_SCOPE(receive_buffer_tests, fixture)
......
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