Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Nov 21, 2023
1 parent e080c15 commit 35df72c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/struct_pack/tests/test_serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ TEST_CASE("test width too big") {
auto result = struct_pack::deserialize<struct_pack::DISABLE_ALL_META_INFO,
std::string>(buffer);
REQUIRE(result.has_value() == false);
if constexpr (SIZE_WIDTH < 8) {
if constexpr (sizeof(std::size_t) < 8) {
CHECK(result.error() == struct_pack::errc::too_width_size);
}
else {
Expand All @@ -1304,7 +1304,7 @@ TEST_CASE("test width too big") {
auto result = struct_pack::deserialize<struct_pack::DISABLE_ALL_META_INFO,
std::string>(buffer, len);
REQUIRE(result.has_value() == false);
if constexpr (SIZE_WIDTH < 8) {
if constexpr (sizeof(std::size_t) < 8) {
CHECK(result.error() == struct_pack::errc::too_width_size);
}
else {
Expand All @@ -1317,7 +1317,7 @@ TEST_CASE("test width too big") {
auto result =
struct_pack::get_field<std::pair<std::string, std::string>, 0>(buffer);
REQUIRE(result.has_value() == false);
if constexpr (SIZE_WIDTH < 8) {
if constexpr (sizeof(std::size_t) < 8) {
CHECK(result.error() == struct_pack::errc::too_width_size);
}
else {
Expand All @@ -1330,7 +1330,7 @@ TEST_CASE("test width too big") {
auto result = struct_pack::deserialize<
std::pair<std::string, struct_pack::compatible<int>>>(buffer);
REQUIRE(result.has_value() == false);
if constexpr (SIZE_WIDTH < 8) {
if constexpr (sizeof(std::size_t) < 8) {
CHECK(result.error() == struct_pack::errc::too_width_size);
}
else {
Expand Down

0 comments on commit 35df72c

Please sign in to comment.