diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7a17b07..397c737 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,7 +7,8 @@ set(TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/HelperTest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/TestMain.cpp ${CMAKE_CURRENT_SOURCE_DIR}/TokenFormatTest.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TokenTest.cpp) + ${CMAKE_CURRENT_SOURCE_DIR}/TokenTest.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/NlohmannTest.cpp) add_executable(jwt-cpp-test ${TEST_SOURCES}) target_compile_options(jwt-cpp-test PRIVATE diff --git a/tests/NlohmannTest.cpp b/tests/NlohmannTest.cpp index 9fd0439..b7848bc 100644 --- a/tests/NlohmannTest.cpp +++ b/tests/NlohmannTest.cpp @@ -26,10 +26,10 @@ struct nlohmann_traits { throw std::logic_error("invalid type"); } - static json::value_t as_object(const json &val) { + static json::object_t as_object(const json &val) { if (val.type() != json::value_t::object) throw std::bad_cast(); - return val.get(); + return val.get(); } static std::string as_string(const json &val) {