Remove test framework's dependency on RTTI:

Allow unit tests to compile with rtti=off

This struct is only used to make sure that there are no duplication of
test suites.  Move it to a concept that works with RTTI disabled.

Signed-off-by: Ed Tanous <ed@tanous.net>

close #2337
This commit is contained in:
Ed Tanous
2021-11-03 11:05:58 -07:00
committed by Richard Hodges
parent 3fd090af3b
commit 071b905bc4
2 changed files with 7 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
Version XXX:
* Remove test framework's dependency on RTTI.
* Fix CVE-2016-9840 in zlib implementation.
* Fix TLS SNI handling in websocket_client_async_ssl example.
* Fix reuse of sliding window in WebSocket permessage_deflate.

View File

@@ -13,6 +13,8 @@
#include <boost/beast/_experimental/unit_test/suite_info.hpp>
#include <boost/beast/_experimental/unit_test/detail/const_container.hpp>
#include <boost/assert.hpp>
#include <boost/type_index.hpp>
#include <boost/functional/hash.hpp>
#include <typeindex>
#include <set>
#include <unordered_set>
@@ -28,7 +30,9 @@ class suite_list
private:
#ifndef NDEBUG
std::unordered_set<std::string> names_;
std::unordered_set<std::type_index> classes_;
using type_index = boost::typeindex::type_index;
std::unordered_set<type_index, boost::hash<type_index>> classes_;
#endif
public:
@@ -65,7 +69,7 @@ suite_list::insert(
{
auto const result(classes_.insert(
std::type_index(typeid(Suite))));
boost::typeindex::type_id<Suite>()));
BOOST_ASSERT(result.second); // Duplicate type
}
#endif