|
|
|
|
@@ -17,8 +17,9 @@
|
|
|
|
|
*/
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
|
|
|
|
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
|
|
|
|
|
#include "../../chrono/manual_clock.h"
|
|
|
|
|
#include "../../unit_test/suite.h"
|
|
|
|
|
|
|
|
|
|
#include "../aged_set.h"
|
|
|
|
|
#include "../aged_map.h"
|
|
|
|
|
#include "../aged_multiset.h"
|
|
|
|
|
@@ -28,6 +29,9 @@
|
|
|
|
|
#include "../aged_unordered_multiset.h"
|
|
|
|
|
#include "../aged_unordered_multimap.h"
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
|
|
#ifndef BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR
|
|
|
|
|
# ifdef _MSC_VER
|
|
|
|
|
# define BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR 0
|
|
|
|
|
@@ -46,7 +50,7 @@
|
|
|
|
|
|
|
|
|
|
namespace beast {
|
|
|
|
|
|
|
|
|
|
class aged_associative_container_TestsBase : public UnitTest
|
|
|
|
|
class aged_associative_container_test_base : public unit_test::suite
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
template <class T>
|
|
|
|
|
@@ -392,56 +396,6 @@ public:
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// Compile time checks
|
|
|
|
|
//
|
|
|
|
|
void checkAliases ()
|
|
|
|
|
{
|
|
|
|
|
typedef std::string Key;
|
|
|
|
|
typedef int T;
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_set <Key>,
|
|
|
|
|
detail::aged_ordered_container <false, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_set");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_multiset <Key>,
|
|
|
|
|
detail::aged_ordered_container <true, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_multiset");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_map <Key, T>,
|
|
|
|
|
detail::aged_ordered_container <false, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_map");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_multimap <Key, T>,
|
|
|
|
|
detail::aged_ordered_container <true, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_multimap");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_set <Key>,
|
|
|
|
|
detail::aged_unordered_container <false, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_unordered_set");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_multiset <Key>,
|
|
|
|
|
detail::aged_unordered_container <true, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_unordered_multiset");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_map <Key, T>,
|
|
|
|
|
detail::aged_unordered_container <false, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_unordered_map");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_multimap <Key, T>,
|
|
|
|
|
detail::aged_unordered_container <true, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_unordered_multimap");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
template <
|
|
|
|
|
class Container,
|
|
|
|
|
class Values
|
|
|
|
|
@@ -603,11 +557,6 @@ public:
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered>
|
|
|
|
|
void testMaybeUnordered();
|
|
|
|
|
|
|
|
|
|
aged_associative_container_TestsBase () : UnitTest (
|
|
|
|
|
"aged_associative_container", "beast")
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
@@ -620,7 +569,7 @@ template <
|
|
|
|
|
>
|
|
|
|
|
typename std::enable_if <
|
|
|
|
|
Container::is_map::value && ! Container::is_multi::value>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkMapContents (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
if (v.empty())
|
|
|
|
|
@@ -651,7 +600,7 @@ template <
|
|
|
|
|
>
|
|
|
|
|
typename std::enable_if <
|
|
|
|
|
std::remove_reference <C>::type::is_unordered::value>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkUnorderedContentsRefRef (C&& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
typedef typename std::remove_reference <C>::type Cont;
|
|
|
|
|
@@ -685,7 +634,7 @@ checkUnorderedContentsRefRef (C&& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class C, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkContentsRefRef (C&& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
typedef typename std::remove_reference <C>::type Cont;
|
|
|
|
|
@@ -715,7 +664,7 @@ checkContentsRefRef (C&& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Cont, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkContents (Cont& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
checkContentsRefRef (c, v);
|
|
|
|
|
@@ -725,7 +674,7 @@ checkContents (Cont& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Cont>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkContents (Cont& c)
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <
|
|
|
|
|
@@ -746,7 +695,7 @@ checkContents (Cont& c)
|
|
|
|
|
// ordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <! IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testConstructEmpty ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -760,7 +709,8 @@ testConstructEmpty ()
|
|
|
|
|
typedef typename Traits::MyAlloc MyAlloc;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " empty");
|
|
|
|
|
//testcase (Traits::name() + " empty");
|
|
|
|
|
testcase ("empty");
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
typename Traits::template Cont <Comp, Alloc> c (
|
|
|
|
|
@@ -790,7 +740,7 @@ testConstructEmpty ()
|
|
|
|
|
// unordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testConstructEmpty ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -806,8 +756,8 @@ testConstructEmpty ()
|
|
|
|
|
typedef typename Traits::MyAlloc MyAlloc;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " empty");
|
|
|
|
|
|
|
|
|
|
//testcase (Traits::name() + " empty");
|
|
|
|
|
testcase ("empty");
|
|
|
|
|
{
|
|
|
|
|
typename Traits::template Cont <Hash, Equal, Alloc> c (
|
|
|
|
|
clock);
|
|
|
|
|
@@ -860,7 +810,7 @@ testConstructEmpty ()
|
|
|
|
|
// ordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <! IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testConstructRange ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -875,7 +825,8 @@ testConstructRange ()
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
auto const v (Traits::values());
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " range");
|
|
|
|
|
//testcase (Traits::name() + " range");
|
|
|
|
|
testcase ("range");
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
typename Traits::template Cont <Comp, Alloc> c (
|
|
|
|
|
@@ -922,7 +873,7 @@ testConstructRange ()
|
|
|
|
|
// unordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testConstructRange ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -939,7 +890,8 @@ testConstructRange ()
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
auto const v (Traits::values());
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " range");
|
|
|
|
|
//testcase (Traits::name() + " range");
|
|
|
|
|
testcase ("range");
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
typename Traits::template Cont <Hash, Equal, Alloc> c (
|
|
|
|
|
@@ -1001,7 +953,7 @@ testConstructRange ()
|
|
|
|
|
// ordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <! IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testConstructInitList ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1015,7 +967,8 @@ testConstructInitList ()
|
|
|
|
|
typedef typename Traits::MyAlloc MyAlloc;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " init-list");
|
|
|
|
|
//testcase (Traits::name() + " init-list");
|
|
|
|
|
testcase ("init-list");
|
|
|
|
|
|
|
|
|
|
// VFALCO TODO
|
|
|
|
|
|
|
|
|
|
@@ -1025,7 +978,7 @@ testConstructInitList ()
|
|
|
|
|
// unordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testConstructInitList ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1041,7 +994,9 @@ testConstructInitList ()
|
|
|
|
|
typedef typename Traits::MyAlloc MyAlloc;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " init-list");
|
|
|
|
|
//testcase (Traits::name() + " init-list");
|
|
|
|
|
testcase ("init-list");
|
|
|
|
|
|
|
|
|
|
// VFALCO TODO
|
|
|
|
|
pass();
|
|
|
|
|
}
|
|
|
|
|
@@ -1054,7 +1009,7 @@ testConstructInitList ()
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testCopyMove ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1063,7 +1018,8 @@ testCopyMove ()
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
auto const v (Traits::values());
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " copy/move");
|
|
|
|
|
//testcase (Traits::name() + " copy/move");
|
|
|
|
|
testcase ("copy/move");
|
|
|
|
|
|
|
|
|
|
// copy
|
|
|
|
|
|
|
|
|
|
@@ -1136,7 +1092,7 @@ testCopyMove ()
|
|
|
|
|
|
|
|
|
|
template <class Container, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkInsertCopy (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
for (auto const& e : v)
|
|
|
|
|
@@ -1146,7 +1102,7 @@ checkInsertCopy (Container& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Container, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkInsertMove (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
Values v2 (v);
|
|
|
|
|
@@ -1157,7 +1113,7 @@ checkInsertMove (Container& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Container, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkInsertHintCopy (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
for (auto const& e : v)
|
|
|
|
|
@@ -1167,7 +1123,7 @@ checkInsertHintCopy (Container& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Container, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkInsertHintMove (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
Values v2 (v);
|
|
|
|
|
@@ -1178,7 +1134,7 @@ checkInsertHintMove (Container& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Container, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkEmplace (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
for (auto const& e : v)
|
|
|
|
|
@@ -1188,7 +1144,7 @@ checkEmplace (Container& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <class Container, class Values>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
checkEmplaceHint (Container& c, Values const& v)
|
|
|
|
|
{
|
|
|
|
|
for (auto const& e : v)
|
|
|
|
|
@@ -1198,7 +1154,7 @@ checkEmplaceHint (Container& c, Values const& v)
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testModifiers()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1206,7 +1162,8 @@ testModifiers()
|
|
|
|
|
auto const v (Traits::values());
|
|
|
|
|
auto const l (make_list (v));
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " modify");
|
|
|
|
|
//testcase (Traits::name() + " modify");
|
|
|
|
|
testcase ("modify");
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
typename Traits::template Cont <> c (clock);
|
|
|
|
|
@@ -1257,7 +1214,7 @@ testModifiers()
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testChronological ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1265,7 +1222,8 @@ testChronological ()
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
auto const v (Traits::values());
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " chronological");
|
|
|
|
|
//testcase (Traits::name() + " chronological");
|
|
|
|
|
testcase ("chronological");
|
|
|
|
|
|
|
|
|
|
typename Traits::template Cont <> c (
|
|
|
|
|
v.begin(), v.end(), clock);
|
|
|
|
|
@@ -1297,14 +1255,15 @@ testChronological ()
|
|
|
|
|
// map, unordered_map
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <IsMap && ! IsMulti>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testArrayCreate()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
auto v (Traits::values());
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " array create");
|
|
|
|
|
//testcase (Traits::name() + " array create");
|
|
|
|
|
testcase ("array create");
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// Copy construct key
|
|
|
|
|
@@ -1332,7 +1291,7 @@ testArrayCreate()
|
|
|
|
|
// ordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <! IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testCompare ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1340,7 +1299,8 @@ testCompare ()
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
auto const v (Traits::values());
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " array create");
|
|
|
|
|
//testcase (Traits::name() + " array create");
|
|
|
|
|
testcase ("array create");
|
|
|
|
|
|
|
|
|
|
typename Traits::template Cont <> c1 (
|
|
|
|
|
v.begin(), v.end(), clock);
|
|
|
|
|
@@ -1366,13 +1326,14 @@ testCompare ()
|
|
|
|
|
// ordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <! IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testObservers()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " observers");
|
|
|
|
|
//testcase (Traits::name() + " observers");
|
|
|
|
|
testcase ("observers");
|
|
|
|
|
|
|
|
|
|
typename Traits::template Cont <> c (clock);
|
|
|
|
|
c.key_comp();
|
|
|
|
|
@@ -1384,13 +1345,14 @@ testObservers()
|
|
|
|
|
// unordered
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
typename std::enable_if <IsUnordered>::type
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testObservers()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
typename Traits::Clock clock;
|
|
|
|
|
|
|
|
|
|
beginTestCase (Traits::name() + " observers");
|
|
|
|
|
//testcase (Traits::name() + " observers");
|
|
|
|
|
testcase ("observers");
|
|
|
|
|
|
|
|
|
|
typename Traits::template Cont <> c (clock);
|
|
|
|
|
c.hash_function();
|
|
|
|
|
@@ -1407,7 +1369,7 @@ testObservers()
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered, bool IsMulti, bool IsMap>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
aged_associative_container_test_base::
|
|
|
|
|
testMaybeUnorderedMultiMap ()
|
|
|
|
|
{
|
|
|
|
|
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
|
|
|
|
|
@@ -1423,38 +1385,133 @@ testMaybeUnorderedMultiMap ()
|
|
|
|
|
testObservers <IsUnordered, IsMulti, IsMap> ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered, bool IsMulti>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
testMaybeUnorderedMulti()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <IsUnordered, IsMulti, false> ();
|
|
|
|
|
testMaybeUnorderedMultiMap <IsUnordered, IsMulti, true> ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <bool IsUnordered>
|
|
|
|
|
void
|
|
|
|
|
aged_associative_container_TestsBase::
|
|
|
|
|
testMaybeUnordered()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMulti <IsUnordered, false> ();
|
|
|
|
|
testMaybeUnorderedMulti <IsUnordered, true> ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
class aged_associative_container_Tests :
|
|
|
|
|
public aged_associative_container_TestsBase
|
|
|
|
|
class aged_set_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void runTest ()
|
|
|
|
|
// Compile time checks
|
|
|
|
|
|
|
|
|
|
typedef std::string Key;
|
|
|
|
|
typedef int T;
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_set <Key>,
|
|
|
|
|
detail::aged_ordered_container <false, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_set");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_multiset <Key>,
|
|
|
|
|
detail::aged_ordered_container <true, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_multiset");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_map <Key, T>,
|
|
|
|
|
detail::aged_ordered_container <false, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_map");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_multimap <Key, T>,
|
|
|
|
|
detail::aged_ordered_container <true, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_multimap");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_set <Key>,
|
|
|
|
|
detail::aged_unordered_container <false, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_unordered_set");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_multiset <Key>,
|
|
|
|
|
detail::aged_unordered_container <true, false, Key, void>>::value,
|
|
|
|
|
"bad alias: aged_unordered_multiset");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_map <Key, T>,
|
|
|
|
|
detail::aged_unordered_container <false, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_unordered_map");
|
|
|
|
|
|
|
|
|
|
static_assert (std::is_same <
|
|
|
|
|
aged_unordered_multimap <Key, T>,
|
|
|
|
|
detail::aged_unordered_container <true, true, Key, T>>::value,
|
|
|
|
|
"bad alias: aged_unordered_multimap");
|
|
|
|
|
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
checkAliases ();
|
|
|
|
|
testMaybeUnordered <false> ();
|
|
|
|
|
testMaybeUnordered <true> ();
|
|
|
|
|
testMaybeUnorderedMultiMap <false, false, false>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static aged_associative_container_Tests aged_associative_container_tests;
|
|
|
|
|
class aged_map_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <false, false, true>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class aged_multiset_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <false, true, false>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class aged_multimap_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <false, true, true>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class aged_unordered_set_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <true, false, false>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class aged_unordered_map_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <true, false, true>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class aged_unordered_multiset_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <true, true, false>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class aged_unordered_multimap_test : public aged_associative_container_test_base
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
void run ()
|
|
|
|
|
{
|
|
|
|
|
testMaybeUnorderedMultiMap <true, true, true>();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_set,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_map,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_multiset,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_multimap,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_unordered_set,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_unordered_map,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_unordered_multiset,container,beast);
|
|
|
|
|
BEAST_DEFINE_TESTSUITE(aged_unordered_multimap,container,beast);
|
|
|
|
|
|
|
|
|
|
}
|