mirror of
https://github.com/boostorg/beast.git
synced 2025-08-01 22:04:34 +02:00
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:
committed by
Richard Hodges
parent
3fd090af3b
commit
071b905bc4
@@ -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.
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user