diff options
Diffstat (limited to 'test/support/container_test_types.h')
-rw-r--r-- | test/support/container_test_types.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/test/support/container_test_types.h b/test/support/container_test_types.h index 08e88f091..b8422ec46 100644 --- a/test/support/container_test_types.h +++ b/test/support/container_test_types.h @@ -234,6 +234,19 @@ inline ConstructController* getConstructController() { return &c; } +template <class ...Args> +struct ExpectConstructGuard { + ExpectConstructGuard(int N) { + auto CC = getConstructController(); + assert(!CC->unchecked()); + CC->expect<Args...>(N); + } + + ~ExpectConstructGuard() { + assert(!getConstructController()->unchecked()); + } +}; + //===----------------------------------------------------------------------===// // ContainerTestAllocator //===----------------------------------------------------------------------===// @@ -417,7 +430,12 @@ namespace std { return arg.data; } }; - + template <class T, class Alloc> + class vector; + template <class T, class Alloc> + class deque; + template <class T, class Alloc> + class list; template <class _Key, class _Value, class _Less, class _Alloc> class map; template <class _Key, class _Value, class _Less, class _Alloc> @@ -444,6 +462,13 @@ _LIBCPP_END_NAMESPACE_STD // TCT - Test container type namespace TCT { +template <class T = CopyInsertable<1>> +using vector = std::vector<T, ContainerTestAllocator<T, T> >; +template <class T = CopyInsertable<1>> +using deque = std::deque<T, ContainerTestAllocator<T, T> >; +template <class T = CopyInsertable<1>> +using list = std::list<T, ContainerTestAllocator<T, T> >; + template <class Key = CopyInsertable<1>, class Value = CopyInsertable<2>, class ValueTp = std::pair<const Key, Value> > using unordered_map = @@ -488,5 +513,4 @@ using multiset = } // end namespace TCT - #endif // SUPPORT_CONTAINER_TEST_TYPES_H |