test: ensure the version numbers agree

This commit is contained in:
Ben Boeckel 2020-10-01 12:22:04 -04:00 committed by Christopher Dunn
parent 72db276986
commit c60ebf787a

View File

@ -3916,6 +3916,16 @@ JSONTEST_FIXTURE_LOCAL(MemberTemplateIs, BehavesSameAsNamedIs) {
} }
} }
class VersionTest : public JsonTest::TestCase {};
JSONTEST_FIXTURE_LOCAL(VersionTest, VersionNumbersMatch) {
std::ostringstream vstr;
vstr << JSONCPP_VERSION_MAJOR << '.'
<< JSONCPP_VERSION_MINOR << '.'
<< JSONCPP_VERSION_PATCH;
JSONTEST_ASSERT_EQUAL(vstr.str(), std::string(JSONCPP_VERSION_STRING));
}
#if defined(__GNUC__) #if defined(__GNUC__)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif