Skip to content

Commit

Permalink
Split libcxx tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Oct 24, 2024
1 parent ef2b96a commit 9f076a9
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 81 deletions.
30 changes: 0 additions & 30 deletions test/sources/LibcxxHashMapTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,4 @@ namespace std

} // namespace libcxx_test_hash_map

#ifdef LIBCXX_TEST_DEFAULT_BUCKET

namespace libcxx_test_hash_map_vp
{

namespace std
{
using namespace ::std;

template<typename TKey, typename TMapped,
typename THashFunc = std::hash<TKey>,
typename TEqualFunc = std::equal_to<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
using unordered_map = momo::stdish::unordered_map<TKey, TMapped, THashFunc, TEqualFunc, TAllocator,
momo::HashMap<TKey, TMapped, momo::HashTraitsStd<TKey, THashFunc, TEqualFunc, LIBCXX_TEST_BUCKET>,
momo::MemManagerStd<TAllocator>,
momo::HashMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>, true>,
LibcxxHashMapSettings>>;
}

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_PREFIX "libcxx_test_hash_map_vp_" LIBCXX_TEST_BUCKET_NAME
#include "libcxx/UnorderedMapTests.h"
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_FAILURE

} // namespace libcxx_test_hash_map_vp

#endif

} // namespace
68 changes: 68 additions & 0 deletions test/sources/LibcxxHashMapVPTesterLimP4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/**********************************************************\
This file is part of the
https://github.com/morzhovets/momo
project, distributed under the MIT License. See
https://github.com/morzhovets/momo/blob/master/LICENSE
for details.
test/sources/LibcxxHashMapVPTesterLimP4.cpp
\**********************************************************/

#include "pch.h"

#ifdef TEST_LIBCXX_HASH_MAP

#include "../../include/momo/details/HashBucketLimP4.h"

//#define LIBCXX_TEST_BUCKET momo::HashBucketLimP4<>
//#define LIBCXX_TEST_BUCKET_NAME "limp4"
#define LIBCXX_TEST_DEFAULT_BUCKET

//#include "LibcxxHashMapTester.h"

#include "LibcxxTester.h"

#include "../../include/momo/stdish/unordered_map.h"

namespace
{

using namespace libcxx_from_range_unord;

class LibcxxHashMapSettings : public momo::HashMapSettings
{
public:
static const momo::CheckMode checkMode = momo::CheckMode::exception;
};

namespace libcxx_test_hash_map_vp
{

namespace std
{
using namespace ::std;

template<typename TKey, typename TMapped,
typename THashFunc = std::hash<TKey>,
typename TEqualFunc = std::equal_to<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
using unordered_map = momo::stdish::unordered_map<TKey, TMapped, THashFunc, TEqualFunc, TAllocator,
momo::HashMap<TKey, TMapped, momo::HashTraitsStd<TKey, THashFunc, TEqualFunc>,
momo::MemManagerStd<TAllocator>,
momo::HashMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>, true>,
LibcxxHashMapSettings>>;
}

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_PREFIX "libcxx_test_hash_map_vp_limp4"
#include "libcxx/UnorderedMapTests.h"
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_FAILURE

} // namespace libcxx_test_hash_map_vp

} // namespace

#endif // TEST_LIBCXX_HASH_MAP
27 changes: 0 additions & 27 deletions test/sources/LibcxxTreeMapTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,6 @@ namespace std

} // namespace libcxx_test_tree_map

namespace libcxx_test_tree_map_vp
{

namespace std
{
using namespace ::std;

template<typename TKey, typename TMapped,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
using map = momo::stdish::map<TKey, TMapped, TLessFunc, TAllocator,
momo::TreeMap<TKey, TMapped, momo::TreeTraitsStd<TKey, TLessFunc, false,
momo::TreeNode<32, 4, momo::MemPoolParams<>, false>>,
momo::MemManagerStd<TAllocator>,
momo::TreeMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>, true>,
momo::TreeMapSettings>>;

template<typename TKey>
using vector = momo::stdish::vector<TKey>;
}

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_map_vp"
#include "libcxx/MapTests.h"
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_map_vp

} // namespace

#endif // TEST_LIBCXX_TREE_MAP
57 changes: 57 additions & 0 deletions test/sources/LibcxxTreeMapVPTester.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**********************************************************\
This file is part of the
https://github.com/morzhovets/momo
project, distributed under the MIT License. See
https://github.com/morzhovets/momo/blob/master/LICENSE
for details.
test/sources/LibcxxTreeMapVPTester.cpp
\**********************************************************/

#include "pch.h"

#ifdef TEST_LIBCXX_TREE_MAP

#include "LibcxxTester.h"

#include "../../include/momo/stdish/map.h"

#include "../../include/momo/stdish/vector.h"

namespace
{

using namespace libcxx_from_range_assoc;

namespace libcxx_test_tree_map_vp
{

namespace std
{
using namespace ::std;

template<typename TKey, typename TMapped,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
using map = momo::stdish::map<TKey, TMapped, TLessFunc, TAllocator,
momo::TreeMap<TKey, TMapped, momo::TreeTraitsStd<TKey, TLessFunc, false,
momo::TreeNode<32, 4, momo::MemPoolParams<>, false>>,
momo::MemManagerStd<TAllocator>,
momo::TreeMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>, true>,
momo::TreeMapSettings>>;

template<typename TKey>
using vector = momo::stdish::vector<TKey>;
}

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_map_vp"
#include "libcxx/MapTests.h"
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_map_vp

} // namespace

#endif // TEST_LIBCXX_TREE_MAP
24 changes: 0 additions & 24 deletions test/sources/LibcxxTreeMultiMapTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,6 @@ namespace std

} // namespace libcxx_test_tree_multimap

namespace libcxx_test_tree_multimap_vp
{

namespace std
{
using namespace ::std;

template<typename TKey, typename TMapped,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
using multimap = momo::stdish::multimap<TKey, TMapped, TLessFunc, TAllocator,
momo::TreeMap<TKey, TMapped, momo::TreeTraitsStd<TKey, TLessFunc, true,
momo::TreeNode<4, 2, momo::MemPoolParams<1>, true>>,
momo::MemManagerStd<TAllocator>,
momo::TreeMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>, true>,
momo::TreeMapSettings>>;
}

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_multimap_vp"
#include "libcxx/MultiMapTests.h"
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_multimap_vp

} // namespace

#endif // TEST_LIBCXX_TREE_MAP
52 changes: 52 additions & 0 deletions test/sources/LibcxxTreeMultiMapVPTester.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**********************************************************\
This file is part of the
https://github.com/morzhovets/momo
project, distributed under the MIT License. See
https://github.com/morzhovets/momo/blob/master/LICENSE
for details.
test/sources/LibcxxTreeMultiMapVPTester.cpp
\**********************************************************/

#include "pch.h"

#ifdef TEST_LIBCXX_TREE_MAP

#include "LibcxxTester.h"

#include "../../include/momo/stdish/map.h"

namespace
{

using namespace libcxx_from_range_assoc;

namespace libcxx_test_tree_multimap_vp
{

namespace std
{
using namespace ::std;

template<typename TKey, typename TMapped,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
using multimap = momo::stdish::multimap<TKey, TMapped, TLessFunc, TAllocator,
momo::TreeMap<TKey, TMapped, momo::TreeTraitsStd<TKey, TLessFunc, true,
momo::TreeNode<4, 2, momo::MemPoolParams<1>, true>>,
momo::MemManagerStd<TAllocator>,
momo::TreeMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>, true>,
momo::TreeMapSettings>>;
}

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_multimap_vp"
#include "libcxx/MultiMapTests.h"
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_multimap_vp

} // namespace

#endif // TEST_LIBCXX_TREE_MAP

0 comments on commit 9f076a9

Please sign in to comment.