Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
McCallisterRomer committed Dec 1, 2023
1 parent 65d15fa commit 3ff079e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/ncutility/BinarySerialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
namespace nc::serialize
{
/**
* @brief Serialize and object to a stream.
* @brief Serialize an object to a stream.
*
* Serialize and Deserialize are function objects with call signatures:
* `void Serialize(std::ostream&, const T&)`
* `void Deserialize(std::istream&, T&)`
*
* Calls to them are equivalent to the first matched valid expression among:
* 1. A non-static member function with the signature:
* `void T::Serialize(std::ostream&)`
* `void T::Serialize(std::ostream&) const`
* `void T::Deserialize(std::istream&)`
* 2. A non-member function found via adl with the signature:
* `void Serialize(std::ostream&, const T&)`
Expand Down
7 changes: 2 additions & 5 deletions test/ncutility/BinarySerialization_unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,14 @@ static_assert(nc::serialize::cpo::HasDeserializeMember<HasMemberFunc>);
TEST(BinarySerializationTest, Serialize_primitives_preservedRoundTrip)
{
auto stream = std::stringstream{};

const auto expectedInt = 42;
const auto expectedFloat = 3.14f;
nc::serialize::Serialize(stream, expectedInt);
nc::serialize::Serialize(stream, expectedFloat);

auto actualInt = 0;
auto actualFloat = 0.0f;
nc::serialize::Serialize(stream, expectedInt);
nc::serialize::Serialize(stream, expectedFloat);
nc::serialize::Deserialize(stream, actualInt);
nc::serialize::Deserialize(stream, actualFloat);

EXPECT_EQ(expectedInt, actualInt);
EXPECT_EQ(expectedFloat, actualFloat);
}
Expand Down

0 comments on commit 3ff079e

Please sign in to comment.