File indexing completed on 2024-11-17 03:42:06

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #ifndef TEST_MACROS_H
0011 #define TEST_MACROS_H
0012 
0013 #include "metatype.h"
0014 
0015 #include <map>
0016 
0017 #include "qtunorderedmap.h"
0018 
0019 #include <array>
0020 
0021 template<typename T>
0022 struct ThreeArray : public std::array<T, 3> {
0023 };
0024 
0025 #define DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, KeyType, ValueType)                                                                                       \
0026     typedef ContainerType<KeyType, ValueType> ContainerType##KeyType##ValueType;                                                                               \
0027     Q_DECLARE_METATYPE(ContainerType##KeyType##ValueType)
0028 
0029 #define DECLARE_ASSOCIATIVE_CONTAINER_TYPES_MINIMAL(ContainerType, ValueType) DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, qint32, ValueType)
0030 
0031 #define DECLARE_ASSOCIATIVE_CONTAINER_TYPES_ALL(ContainerType, ValueType)                                                                                      \
0032     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, qint16, ValueType)                                                                                            \
0033     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, qint32, ValueType)                                                                                            \
0034     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, qint64, ValueType)                                                                                            \
0035     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, quint16, ValueType)                                                                                           \
0036     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, quint32, ValueType)                                                                                           \
0037     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, quint64, ValueType)                                                                                           \
0038     DECLARE_ASSOCIATIVE_CONTAINER(ContainerType, QString, ValueType)
0039 
0040 #ifndef MINIMAL_CONTAINER_TESTS
0041 #define DECLARE_ASSOCIATIVE_CONTAINER_TYPES DECLARE_ASSOCIATIVE_CONTAINER_TYPES_ALL
0042 #else
0043 #define DECLARE_ASSOCIATIVE_CONTAINER_TYPES DECLARE_ASSOCIATIVE_CONTAINER_TYPES_MINIMAL
0044 #endif
0045 
0046 #endif