Skip to content

Commit

Permalink
fix some msvc warning
Browse files Browse the repository at this point in the history
1. unit-udt.cpp(248,24): warning C4189: 'large_id': local variable is initialized but not referenced
2. unit-udt.cpp(167,13): warning C4505: 'udt::operator ==': unreferenced function with internal linkage has been removed
  • Loading branch information
EfesX committed Jun 1, 2024
1 parent 6638b22 commit 8cbf7ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/src/unit-udt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,13 @@ static bool operator==(const contact& lhs, const contact& rhs)
return std::tie(lhs.m_person, lhs.m_address) ==
std::tie(rhs.m_person, rhs.m_address);
}

#if JSON_DISABLE_ENUM_SERIALIZATION
static bool operator==(const contact_book& lhs, const contact_book& rhs)
{
return std::tie(lhs.m_book_name, lhs.m_book_id, lhs.m_contacts) ==
std::tie(rhs.m_book_name, rhs.m_book_id, rhs.m_contacts);
}
#endif // JSON_DISABLE_ENUM_SERIALIZATION
} // namespace udt

// from_json methods
Expand Down Expand Up @@ -245,7 +246,9 @@ TEST_CASE("basic usage" * doctest::test_suite("udt"))
const udt::person senior_programmer{{42}, {"王芳"}, udt::country::china};
const udt::address addr{"Paris"};
const udt::contact cpp_programmer{sfinae_addict, addr};
#if JSON_DISABLE_ENUM_SERIALIZATION
const udt::book_id large_id{static_cast<udt::book_id>(static_cast<std::uint64_t>(1) << 63)}; // verify large unsigned enums are handled correctly
#endif // JSON_DISABLE_ENUM_SERIALIZATION
const udt::contact_book book{{"C++"}, static_cast<udt::book_id>(42u), {cpp_programmer, {senior_programmer, addr}}};

SECTION("conversion to json via free-functions")
Expand Down

0 comments on commit 8cbf7ba

Please sign in to comment.