Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Oct 11, 2023
1 parent 286eac4 commit 34f9b3d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
1 change: 1 addition & 0 deletions include/ylt/struct_pack/varint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <system_error>
#include <type_traits>

#include "endian_wrapper.hpp"
#include "reflection.hpp"
namespace struct_pack {

Expand Down
32 changes: 0 additions & 32 deletions src/struct_pack/tests/test_cross_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,4 @@ TEST_CASE("testing deserialize other platform data without debug info") {
REQUIRE(result.has_value());
auto object = create_complicated_object();
CHECK(result.value() == object);
}

TEST_CASE("testing serialize other platform data") {
std::ifstream ifs("binary_data/test_cross_platform.dat");
if (!ifs.is_open()) {
ifs.open("src/struct_pack/tests/binary_data/test_cross_platform.dat");
}
REQUIRE(ifs.is_open());
std::string content(std::istreambuf_iterator<char>{ifs},
std::istreambuf_iterator<char>{});
auto object = create_complicated_object();
auto buffer =
struct_pack::serialize<std::string,
struct_pack::type_info_config::enable>(object);
CHECK(buffer == content);
}

TEST_CASE("testing serialize other platform data") {
std::ifstream ifs("binary_data/test_cross_platform_without_debug_info.dat");
if (!ifs.is_open()) {
ifs.open(
"src/struct_pack/tests/binary_data/"
"test_cross_platform_without_debug_info.dat");
}
REQUIRE(ifs.is_open());
std::string content(std::istreambuf_iterator<char>{ifs},
std::istreambuf_iterator<char>{});
auto object = create_complicated_object();
auto buffer =
struct_pack::serialize<std::string,
struct_pack::type_info_config::disable>(object);
CHECK(buffer == content);
}

0 comments on commit 34f9b3d

Please sign in to comment.