Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jul 31, 2023
1 parent 6901a2d commit bec9653
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/struct_pack/benchmark/msgpack_sample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct message_pack_sample : public base_sample {
}

private:
template<typename T>
template <typename T>
void serialize(SampleType sample_type, T &sample) {
{
msgpack::pack(buffer_, sample);
Expand All @@ -69,9 +69,8 @@ struct message_pack_sample : public base_sample {
buf_size_map_.emplace(sample_type, buffer_.size());
}

template<typename T>
template <typename T>
void deserialize(SampleType sample_type, T &sample) {

// get serialized buffer of sample for deserialize
buffer_.clear();
msgpack::pack(buffer_, sample);
Expand Down
4 changes: 2 additions & 2 deletions src/struct_pack/benchmark/struct_pb_sample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct struct_pb_sample_t : public base_sample {
}

private:
template<typename T>
template <typename T>
void serialize(SampleType sample_type, T& sample) {
auto sz = struct_pb::internal::get_needed_size(sample);
buffer_.resize(sz);
Expand Down Expand Up @@ -144,7 +144,7 @@ struct struct_pb_sample_t : public base_sample {
buf_size_map_.emplace(sample_type, buffer_.size());
}

template<typename T>
template <typename T>
void deserialize(SampleType sample_type, T& sample) {
buffer_.clear();
auto sz = struct_pb::internal::get_needed_size(sample);
Expand Down
4 changes: 2 additions & 2 deletions src/struct_pack/tests/test_pragma_pack_and_alignas_mix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ TEST_CASE("testing mix and compatible nested") {
auto result = struct_pack::deserialize<
test_pragma_pack_and_alignas_and_compatible_mix::dummy_2_4_v2>(buffer);
CHECK(result.has_value() == true);
auto val=result.value();
auto val = result.value();
CHECK(val == v2);
}
{
auto buffer = struct_pack::serialize(v2);
auto result = struct_pack::deserialize<
test_pragma_pack_and_alignas_and_compatible_mix::dummy_2_4_v1>(buffer);
CHECK(result.has_value() == true);
auto val=result.value();
auto val = result.value();
CHECK(val == v1);
}
}
Expand Down

0 comments on commit bec9653

Please sign in to comment.