Skip to content

Commit

Permalink
More errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Sep 26, 2023
1 parent 1362ea7 commit 645f925
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/extension/network/NUClearNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ namespace extension {
// Work out what chunk of data we are sending
// const cast is fine as posix guarantees it won't be modified on a sendmsg
const char* start = reinterpret_cast<const char*>(payload.data()) + (packet_no * packet_data_mtu);
data[1].iov_base = const_cast<char*>(start);
data[1].iov_base = const_cast<char*>(start); // NOLINT(cppcoreguidelines-pro-type-const-cast)
data[1].iov_len = packet_no + 1 < header.packet_count ? packet_data_mtu : payload.size() % packet_data_mtu;

// Set our target and send (once again const cast is fine)
Expand Down
8 changes: 2 additions & 6 deletions tests/util/serialise/serialise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ SCENARIO("Serialisation works correctly on single primitives", "[util][serialise
auto serialised = NUClear::util::serialise::Serialise<uint32_t>::serialise(deserialised);

THEN("The serialised data is the same as the input") {
REQUIRE(serialised.size() == in.size());
REQUIRE(serialised == in);
}
}
Expand Down Expand Up @@ -141,7 +140,6 @@ TEMPLATE_TEST_CASE("Scenario: Serialisation works correctly on iterables of prim
auto serialised = NUClear::util::serialise::Serialise<TestType>::serialise(deserialised);

THEN("The serialised data is the same as the input") {
REQUIRE(serialised.size() == in.size());
REQUIRE(serialised == in);
}
}
Expand All @@ -164,7 +162,7 @@ TEMPLATE_TEST_CASE("Scenario: Serialisation works correctly on iterables of prim
auto deserialised = NUClear::util::serialise::Serialise<TestType>::deserialise(in);

THEN("The deserialised data is empty") {
REQUIRE(deserialised.size() == 0);
REQUIRE(deserialised.empty());
}
}
}
Expand Down Expand Up @@ -231,7 +229,6 @@ SCENARIO("Serialisation works correctly on single trivially copyable types", "[u
auto serialised = NUClear::util::serialise::Serialise<TriviallyCopyable>::serialise(deserialised);

THEN("The serialised data is the same as the input") {
REQUIRE(serialised.size() == in.size());
REQUIRE(serialised == in);
}
}
Expand Down Expand Up @@ -309,7 +306,6 @@ TEMPLATE_TEST_CASE("Scenario: Serialisation works correctly on iterables of triv
auto serialised = NUClear::util::serialise::Serialise<TestType>::serialise(deserialised);

THEN("The serialised data is the same as the input") {
REQUIRE(serialised.size() == in.size());
REQUIRE(serialised == in);
}
}
Expand All @@ -332,7 +328,7 @@ TEMPLATE_TEST_CASE("Scenario: Serialisation works correctly on iterables of triv
auto deserialised = NUClear::util::serialise::Serialise<TestType>::deserialise(in);

THEN("The deserialised data is empty") {
REQUIRE(deserialised.size() == 0);
REQUIRE(deserialised.empty());
}
}
}
Expand Down

0 comments on commit 645f925

Please sign in to comment.