From f45db90c43fce07ea10f3849f461b0ad6a86552c Mon Sep 17 00:00:00 2001 From: Christopher McArthur Date: Wed, 20 May 2020 14:36:50 -0400 Subject: [PATCH] fixing error is nholmann traits --- tests/CMakeLists.txt | 3 ++- tests/NlohmannTest.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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) {