Skip to content

Commit

Permalink
#2273: tests: add new test for memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander authored and cwschilly committed Sep 20, 2024
1 parent 6943836 commit 4b39ad1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/unit/serialization/test_serialize_messenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ static void myDataMsgHan(MyDataMsg* msg) {
msg->check();
}

static void myDataHan(std::vector<int> const& vec) {
int i = 0;
EXPECT_EQ(vec.size(), 100ull);
for (auto&& x : vec) {
EXPECT_EQ(x, i);
i++;
}
}

struct TestSerialMessenger : TestParallelHarness {
using TestMsg = TestStaticBytesShortMsg<4>;
};
Expand All @@ -115,6 +124,15 @@ TEST_F(TestSerialMessenger, test_serial_messenger_1) {
}
}

TEST_F(TestSerialMessenger, test_serial_messenger_2) {
auto const& this_node = theContext()->getNode();
std::vector<int> vec;
for (int i = 0; i < 100; i++) {
vec.push_back(i);
}
theMsg()->send<&myDataHan>(vt::Node(this_node), vec);
}

TEST_F(TestSerialMessenger, test_serial_messenger_bcast_1) {
auto const& my_node = theContext()->getNode();

Expand Down

0 comments on commit 4b39ad1

Please sign in to comment.