Skip to content

Commit c3609a8

Browse files
committed
temporary fix
Signed-off-by: Santiago Figueroa Manrique <figueroa1395@gmail.com>
1 parent 7f94da0 commit c3609a8

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/native_api_tests/test_api_serialization.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
#include <string>
1515
#include <vector>
1616

17-
namespace nlohmann::detail {
18-
template <> struct char_traits<std::byte> : char_traits<std::underlying_type_t<std::byte>> {
19-
using char_type = std::byte;
20-
21-
// Redefine to_int_type function
22-
static int_type to_int_type(char_type c) noexcept { return static_cast<int_type>(c); }
23-
};
24-
} // namespace nlohmann::detail
2517
namespace power_grid_model_cpp {
2618
namespace {
2719
using namespace std::string_literals;
@@ -89,7 +81,9 @@ TEST_CASE("API Serialization and Deserialization") {
8981
SUBCASE("Round trip") {
9082
std::vector<std::byte> msgpack_data{};
9183
msgpack_serializer.get_to_binary_buffer(0, msgpack_data);
92-
auto const json_document = nlohmann::ordered_json::from_msgpack(msgpack_data);
84+
auto const char_start = reinterpret_cast<unsigned char const*>(msgpack_data.data());
85+
auto const char_end = char_start + msgpack_data.size();
86+
auto const json_document = nlohmann::ordered_json::from_msgpack(char_start, char_end);
9387
auto const json_result = json_document.dump(-1);
9488
CHECK(json_result == json_data);
9589
}

0 commit comments

Comments
 (0)