Skip to content

Commit

Permalink
Update libcxx tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Jan 4, 2024
1 parent bb4ab3f commit 68a390c
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 15 deletions.
8 changes: 6 additions & 2 deletions test/sources/LibcxxArrayTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ class LibcxxArraySettings : public momo::ArraySettings<0, false>
static const momo::CheckMode checkMode = momo::CheckMode::exception;
};

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TValue,
typename TAllocator = std::allocator<TValue>>
using vector = momo::stdish::vector<TValue, TAllocator,
momo::Array<TValue, momo::MemManagerStd<TAllocator>,
momo::ArrayItemTraits<TValue, momo::MemManagerStd<TAllocator>>, LibcxxArraySettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_ARRAY
#define LIBCXX_TEST_PREFIX "libcxx_test_array_0"
#include "libcxx/VectorTests.h"
#include LIBCXX_HEADER(VectorTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_ARRAY
#undef LIBCXX_TEST_FAILURE
Expand All @@ -46,13 +48,15 @@ using vector = momo::stdish::vector<TValue, TAllocator,
namespace libcxx_test_array_5
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TValue,
typename TAllocator = std::allocator<TValue>>
using vector = momo::stdish::vector_intcap<5, TValue, TAllocator>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_INTCAP_ARRAY
#define LIBCXX_TEST_PREFIX "libcxx_test_array_5"
#include "libcxx/VectorTests.h"
#include LIBCXX_HEADER(VectorTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_INTCAP_ARRAY

Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxHashMapTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class LibcxxHashMapSettings : public momo::HashMapSettings
namespace libcxx_test_hash_map
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey, typename TMapped,
typename THashFunc = std::hash<TKey>,
typename TEqualFunc = std::equal_to<TKey>,
Expand All @@ -37,10 +38,11 @@ using unordered_map = momo::stdish::unordered_map<TKey, TMapped, THashFunc, TEqu
momo::MemManagerStd<TAllocator>,
momo::HashMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>>,
LibcxxHashMapSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_PREFIX "libcxx_test_hash_map_" LIBCXX_TEST_BUCKET_NAME
#include "libcxx/UnorderedMapTests.h"
#include LIBCXX_HEADER(UnorderedMapTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_FAILURE

Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxHashMapTesterOpen8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ namespace
namespace libcxx_test_hash_map
{

LIBCXX_NAMESPACE_STD_BEGIN
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_open<TKey, TMapped,
THashFunc, TEqualFunc, TAllocator>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_hash_map_open"
#include "libcxx/UnorderedMapTests.h"
#include LIBCXX_HEADER(UnorderedMapTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_hash_map
Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxHashMultiMapTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class LibcxxHashMultiMapSettings : public momo::HashMultiMapSettings
namespace libcxx_test_hash_multimap
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey, typename TMapped,
typename THashFunc = std::hash<TKey>,
typename TEqualFunc = std::equal_to<TKey>,
Expand All @@ -37,10 +38,11 @@ using unordered_multimap = momo::stdish::unordered_multimap<TKey, TMapped, THash
momo::MemManagerStd<TAllocator>,
momo::HashMultiMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>>,
LibcxxHashMultiMapSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_PREFIX "libcxx_test_hash_multimap_" LIBCXX_TEST_BUCKET_NAME
#include "libcxx/UnorderedMultiMapTests.h"
#include LIBCXX_HEADER(UnorderedMultiMapTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_FAILURE

Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxHashMultiMapTesterOpen8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ namespace
namespace libcxx_test_hash_multimap
{

LIBCXX_NAMESPACE_STD_BEGIN
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_multimap = momo::stdish::unordered_multimap_open<TKey, TMapped,
THashFunc, TEqualFunc, TAllocator>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_hash_multimap_open"
#include "libcxx/UnorderedMultiMapTests.h"
#include LIBCXX_HEADER(UnorderedMultiMapTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_hash_multimap
Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxHashSetTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class LibcxxHashSetSettings : public momo::HashSetSettings
namespace libcxx_test_hash_set
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey,
typename THashFunc = std::hash<TKey>,
typename TEqualFunc = std::equal_to<TKey>,
Expand All @@ -37,10 +38,11 @@ using unordered_set = momo::stdish::unordered_set<TKey, THashFunc, TEqualFunc, T
momo::MemManagerStd<TAllocator>,
momo::HashSetItemTraits<TKey, momo::MemManagerStd<TAllocator>>,
LibcxxHashSetSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_PREFIX "libcxx_test_hash_set_" LIBCXX_TEST_BUCKET_NAME
#include "libcxx/UnorderedSetTests.h"
#include LIBCXX_HEADER(UnorderedSetTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_FAILURE

Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxHashSetTesterOpen8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ namespace
namespace libcxx_test_hash_set
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey,
typename THashFunc = std::hash<TKey>,
typename TEqualFunc = std::equal_to<TKey>,
typename TAllocator = std::allocator<TKey>>
using unordered_set = momo::stdish::unordered_set_open<TKey, THashFunc, TEqualFunc, TAllocator>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_hash_set_open"
#include "libcxx/UnorderedSetTests.h"
#include LIBCXX_HEADER(UnorderedSetTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_hash_set
Expand Down
8 changes: 6 additions & 2 deletions test/sources/LibcxxSegmentedArrayTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ class LibcxxSegmentedArraySettings
static const momo::CheckMode checkMode = momo::CheckMode::exception;
};

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TValue,
typename TAllocator = std::allocator<TValue>>
using vector = momo::stdish::vector<TValue, TAllocator,
momo::SegmentedArray<TValue, momo::MemManagerStd<TAllocator>,
momo::SegmentedArrayItemTraits<TValue, momo::MemManagerStd<TAllocator>>,
LibcxxSegmentedArraySettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_SEGMENTED_ARRAY
#define LIBCXX_TEST_PREFIX "libcxx_test_segmented_array_sqrt"
#include "libcxx/VectorTests.h"
#include LIBCXX_HEADER(VectorTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_SEGMENTED_ARRAY
#undef LIBCXX_TEST_FAILURE
Expand All @@ -56,17 +58,19 @@ class LibcxxSegmentedArraySettings
static const momo::CheckMode checkMode = momo::CheckMode::exception;
};

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TValue,
typename TAllocator = std::allocator<TValue>>
using vector = momo::stdish::vector<TValue, TAllocator,
momo::SegmentedArray<TValue, momo::MemManagerStd<TAllocator>,
momo::SegmentedArrayItemTraits<TValue, momo::MemManagerStd<TAllocator>>,
LibcxxSegmentedArraySettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_FAILURE
#define LIBCXX_TEST_SEGMENTED_ARRAY
#define LIBCXX_TEST_PREFIX "libcxx_test_segmented_array_cnst"
#include "libcxx/VectorTests.h"
#include LIBCXX_HEADER(VectorTests.h)
#undef LIBCXX_TEST_PREFIX
#undef LIBCXX_TEST_SEGMENTED_ARRAY
#undef LIBCXX_TEST_FAILURE
Expand Down
9 changes: 8 additions & 1 deletion test/sources/LibcxxTester.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@

#pragma once

#include "libcxx/Support.h"
#define LIBCXX_TO_STR(expr) #expr
#define LIBCXX_HEADER(header) LIBCXX_TO_STR(libcxx/header)

#include LIBCXX_HEADER(Support.h)

#include <iostream>

#define LIBCXX_NAMESPACE_STD_BEGIN

#define LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_BEGIN(name) \
namespace name { \
void main(); \
Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxTreeMapTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace libcxx_test_tree_map
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey, typename TMapped,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
Expand All @@ -30,9 +31,10 @@ using map = momo::stdish::map<TKey, TMapped, TLessFunc, TAllocator,
momo::MemManagerStd<TAllocator>,
momo::TreeMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>>,
momo::TreeMapSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_map"
#include "libcxx/MapTests.h"
#include LIBCXX_HEADER(MapTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_map
Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxTreeMultiMapTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace libcxx_test_tree_multimap
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey, typename TMapped,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
Expand All @@ -30,9 +31,10 @@ using multimap = momo::stdish::multimap<TKey, TMapped, TLessFunc, TAllocator,
momo::MemManagerStd<TAllocator>,
momo::TreeMapKeyValueTraits<TKey, TMapped, momo::MemManagerStd<TAllocator>>,
momo::TreeMapSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_multimap"
#include "libcxx/MultiMapTests.h"
#include LIBCXX_HEADER(MultiMapTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_multimap
Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxTreeMultiSetTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace libcxx_test_tree_multiset
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<TKey>>
Expand All @@ -30,9 +31,10 @@ using multiset = momo::stdish::multiset<TKey, TLessFunc, TAllocator,
momo::MemManagerStd<TAllocator>,
momo::TreeSetItemTraits<TKey, momo::MemManagerStd<TAllocator>>,
momo::TreeSetSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_multiset"
#include "libcxx/MultiSetTests.h"
#include LIBCXX_HEADER(MultiSetTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_multiset
Expand Down
4 changes: 3 additions & 1 deletion test/sources/LibcxxTreeSetTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace libcxx_test_tree_set
{

LIBCXX_NAMESPACE_STD_BEGIN
template<typename TKey,
typename TLessFunc = std::less<TKey>,
typename TAllocator = std::allocator<TKey>>
Expand All @@ -30,9 +31,10 @@ using set = momo::stdish::set<TKey, TLessFunc, TAllocator,
momo::MemManagerStd<TAllocator>,
momo::TreeSetItemTraits<TKey, momo::MemManagerStd<TAllocator>>,
momo::TreeSetSettings>>;
LIBCXX_NAMESPACE_STD_END

#define LIBCXX_TEST_PREFIX "libcxx_test_tree_set"
#include "libcxx/SetTests.h"
#include LIBCXX_HEADER(SetTests.h)
#undef LIBCXX_TEST_PREFIX

} // namespace libcxx_test_tree_set
Expand Down

0 comments on commit 68a390c

Please sign in to comment.