-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.hpp
186 lines (158 loc) · 6.17 KB
/
test.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/**
** This file is part of the constexprStd project.
** Copyright 2017 Björn Schäpers <bjoern@hazardy.de>.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as
** published by the Free Software Foundation, either version 3 of the
** License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
#ifndef TEST_HPP
#define TEST_HPP
#include <QTest>
#include <string>
#include <utility>
class TestConstexprStd : public QObject {
Q_OBJECT
private slots:
//Internals
void testUninitialized(void) const noexcept;
//Algorithm lib
//Non-modifying sequence operations
void testAllAnyNone(void) const noexcept;
void testForEach(void) const noexcept;
void testForEachN(void) const noexcept;
void testCount(void) const noexcept;
void testCountIf(void) const noexcept;
void testMismatch(void) const noexcept;
void testEqual(void) const noexcept;
void testUnequal(void) const noexcept;
void testFind(void) const noexcept;
void testFindIf(void) const noexcept;
void testFindIfNot(void) const noexcept;
void testFindEnd(void) const noexcept;
void testFindFirstOf(void) const noexcept;
void testAdjacentFind(void) const noexcept;
void testSearch(void) const noexcept;
void testSearchSearcher(void) const noexcept;
void testSearchN(void) const noexcept;
//Modifying sequence operations
void testCopy(void) const noexcept;
void testCopyIf(void) const noexcept;
void testCopyN(void) const noexcept;
void testCopyBackward(void) const noexcept;
void testMove(void) const noexcept;
void testMoveBackward(void) const noexcept;
void testFill(void) const noexcept;
void testFillN(void) const noexcept;
void testTransform(void) const noexcept;
void testGenerate(void) const noexcept;
void testGenerateN(void) const noexcept;
void testRemoveIf(void) const noexcept;
void testRemoveCopyIf(void) const noexcept;
void testReplaceIf(void) const noexcept;
void testReplaceCopyIf(void) const noexcept;
void testSwapRanges(void) const noexcept;
void testReverse(void) const noexcept;
void testReverseCopy(void) const noexcept;
void testRotate(void) const noexcept;
void testRotateCopy(void) const noexcept;
void testUnique(void) const noexcept;
void testUniqueCopy(void) const noexcept;
//Partitioning operations
void testIsPartioned(void) const noexcept;
void testPartition(void) const noexcept;
void testPartitionCopy(void) const noexcept;
void testStablePartition(void) const noexcept;
void testPartitionPoint(void) const noexcept;
//Sorting operations
void testIsSortedUntil(void) const noexcept;
void testIsSorted(void) const noexcept;
void testSort(void) const noexcept;
void testNthElement(void) const noexcept;
void testPartialSort(void) const noexcept;
void testPartialSortCopy(void) const noexcept;
//Heap operations
void testIsHeapUntil(void) const noexcept;
void testIsHeap(void) const noexcept;
void testPushHeap(void) const noexcept;
void testMakeHeap(void) const noexcept;
void testPopHeap(void) const noexcept;
void testSortHeap(void) const noexcept;
void testHeapRandom(void) const noexcept;
//Set operations (on sorted ranges)
void testMerge(void) const noexcept;
void testMergeInplace(void) const noexcept;
//Minimum/maximum operations
void testLexicographicalCompare(void) const noexcept;
//Permutations
void testIsPermutation(void) const noexcept;
//Function objects
//Polymorphic function wrappers
void testInvoke(void) const noexcept;
//Negators
void testNotFn(void) const noexcept;
//Searcher
void testDefaultSeracher(void) const noexcept;
//Iterator lib
//Iterator adaptors
void testInsert_iterator(void) const noexcept;
//Iterator operations
void testAdvance(void) const noexcept;
void testDistance(void) const noexcept;
void testNext(void) const noexcept;
void testPrev(void) const noexcept;
//Dynamic memory management
//Allocators
void testAllocator(void) const noexcept;
//Utility lib
void testBitset(void) const noexcept;
//Variant
void testVariantStaticAsserts(void) const noexcept;
void testVariantConstructor(void) const noexcept;
void testVariantDestructor(void) const noexcept;
void testVariantInteraction(void) const noexcept;
void testVariantEmplace(void) const noexcept;
void testVariantCopyAssign(void) const noexcept;
void testVariantMoveAssign(void) const noexcept;
void testVariantConvertAssign(void) const noexcept;
void testVariantCompare(void) const noexcept;
//Variant extension
void testDifferentVariantCompare(void) const noexcept;
void testDifferentVariantAssign(void) const noexcept;
//Pairs and tuples
void testPair(void) const noexcept;
void testPairComparison(void) const noexcept;
void testPairComparison_data(void) const noexcept;
//Swap, forward and move
void testExchange(void) const noexcept;
void testSwap(void) const noexcept;
//Container
void testSet(void) const noexcept;
void testSetTransparentCompare(void) const noexcept;
void testSetErase(void) const noexcept;
void testSetComparisonOperators(void) const noexcept;
void testSetFailCaseOne(void) const noexcept;
void testSetRandom(void) const noexcept;
public:
explicit TestConstexprStd(QObject *parent = nullptr);
};
namespace QTest {
inline bool qCompare(const std::string& t1, const char *t2, const char *actual, const char *expected, const char *file,
const int line) {
return compare_string_helper(t1.c_str(), t2, actual, expected, file, line);
}
template<>
inline char* toString<std::pair<int, int>>(const std::pair<int, int>& pair) {
return toString(QStringLiteral("{%1,%2}").arg(pair.first).arg(pair.second));
}
} //namespace QTest
#endif