Skip to content

Commit

Permalink
fixing error is nholmann traits
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc committed May 20, 2020
1 parent b3de79d commit f45db90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/NlohmannTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<json::value_t>();
return val.get<json::object_t>();
}

static std::string as_string(const json &val) {
Expand Down

0 comments on commit f45db90

Please sign in to comment.