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 35df72c commit 1c6be6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/struct_pack/tests/test_optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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 @@ -22,7 +22,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 @@ -35,7 +35,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 @@ -48,7 +48,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 1c6be6b

Please sign in to comment.