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
|
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////
#include "EASTLTest.h"
#include <EAStdC/EASprintf.h>
#include <EASTL/internal/config.h>
EA_DISABLE_ALL_VC_WARNINGS()
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
EA_RESTORE_ALL_VC_WARNINGS()
#include "EAMain/EAEntryPointMain.inl"
#include "EASTLTestAllocator.h"
///////////////////////////////////////////////////////////////////////////////
// Required by EASTL.
//
#if !EASTL_EASTDC_VSNPRINTF
int Vsnprintf8(char* pDestination, size_t n, const char* pFormat, va_list arguments)
{
return EA::StdC::Vsnprintf(pDestination, n, pFormat, arguments);
}
int Vsnprintf16(char16_t* pDestination, size_t n, const char16_t* pFormat, va_list arguments)
{
return EA::StdC::Vsnprintf(pDestination, n, pFormat, arguments);
}
int Vsnprintf32(char32_t* pDestination, size_t n, const char32_t* pFormat, va_list arguments)
{
return EA::StdC::Vsnprintf(pDestination, n, pFormat, arguments);
}
#if defined(EA_CHAR8_UNIQUE) && EA_CHAR8_UNIQUE
int Vsnprintf8(char8_t* pDestination, size_t n, const char8_t* pFormat, va_list arguments)
{
return EA::StdC::Vsnprintf(pDestination, n, pFormat, arguments);
}
#endif
#if defined(EA_WCHAR_UNIQUE) && EA_WCHAR_UNIQUE
int VsnprintfW(wchar_t* pDestination, size_t n, const wchar_t* pFormat, va_list arguments)
{
return EA::StdC::Vsnprintf(pDestination, n, pFormat, arguments);
}
#endif
#endif
///////////////////////////////////////////////////////////////////////////////
// EAMain
//
int EAMain(int argc, char* argv[])
{
using namespace EA::UnitTest;
int nErrorCount = 0;
EA::EAMain::PlatformStartup();
EASTLTest_SetGeneralAllocator();
nErrorCount += EASTLTest_CheckMemory();
// Parse command line arguments
for(int i = 1; i < argc; i++)
{
// Example usage: -l:7
if(strstr(argv[i], "-l:") == argv[i])
{
gEASTL_TestLevel = atoi(argv[i] + 3);
if(gEASTL_TestLevel < kEASTL_TestLevelLow)
gEASTL_TestLevel = kEASTL_TestLevelLow;
if(gEASTL_TestLevel > kEASTL_TestLevelHigh)
gEASTL_TestLevel = kEASTL_TestLevelHigh;
}
}
TestApplication testSuite("EASTL Unit Tests", argc, argv);
testSuite.AddTest("Algorithm", TestAlgorithm);
testSuite.AddTest("Allocator", TestAllocator);
testSuite.AddTest("Any", TestAny);
testSuite.AddTest("Array", TestArray);
testSuite.AddTest("BitVector", TestBitVector);
testSuite.AddTest("Bitset", TestBitset);
testSuite.AddTest("CharTraits", TestCharTraits);
testSuite.AddTest("Chrono", TestChrono);
testSuite.AddTest("Deque", TestDeque);
testSuite.AddTest("Extra", TestExtra);
testSuite.AddTest("Finally", TestFinally);
testSuite.AddTest("FixedFunction", TestFixedFunction);
testSuite.AddTest("FixedHash", TestFixedHash);
testSuite.AddTest("FixedList", TestFixedList);
testSuite.AddTest("FixedMap", TestFixedMap);
testSuite.AddTest("FixedSList", TestFixedSList);
testSuite.AddTest("FixedSet", TestFixedSet);
testSuite.AddTest("FixedString", TestFixedString);
testSuite.AddTest("FixedTupleVector", TestFixedTupleVector);
testSuite.AddTest("FixedVector", TestFixedVector);
testSuite.AddTest("Functional", TestFunctional);
testSuite.AddTest("Hash", TestHash);
testSuite.AddTest("Heap", TestHeap);
testSuite.AddTest("IntrusiveHash", TestIntrusiveHash);
testSuite.AddTest("IntrusiveList", TestIntrusiveList);
testSuite.AddTest("IntrusiveSDList", TestIntrusiveSDList);
testSuite.AddTest("IntrusiveSList", TestIntrusiveSList);
testSuite.AddTest("Iterator", TestIterator);
testSuite.AddTest("LRUCache", TestLruCache);
testSuite.AddTest("List", TestList);
testSuite.AddTest("ListMap", TestListMap);
testSuite.AddTest("Map", TestMap);
testSuite.AddTest("Memory", TestMemory);
testSuite.AddTest("Meta", TestMeta);
testSuite.AddTest("NumericLimits", TestNumericLimits);
testSuite.AddTest("Optional", TestOptional);
testSuite.AddTest("Random", TestRandom);
testSuite.AddTest("Ratio", TestRatio);
testSuite.AddTest("RingBuffer", TestRingBuffer);
testSuite.AddTest("SList", TestSList);
testSuite.AddTest("SegmentedVector", TestSegmentedVector);
testSuite.AddTest("Set", TestSet);
testSuite.AddTest("SmartPtr", TestSmartPtr);
testSuite.AddTest("Sort", TestSort);
testSuite.AddTest("Span", TestSpan);
testSuite.AddTest("String", TestString);
testSuite.AddTest("StringHashMap", TestStringHashMap);
testSuite.AddTest("StringMap", TestStringMap);
testSuite.AddTest("StringView", TestStringView);
testSuite.AddTest("TestCppCXTypeTraits", TestCppCXTypeTraits);
testSuite.AddTest("Tuple", TestTuple);
testSuite.AddTest("TupleVector", TestTupleVector);
testSuite.AddTest("TypeTraits", TestTypeTraits);
testSuite.AddTest("Utility", TestUtility);
testSuite.AddTest("Variant", TestVariant);
testSuite.AddTest("Vector", TestVector);
testSuite.AddTest("VectorMap", TestVectorMap);
testSuite.AddTest("VectorSet", TestVectorSet);
testSuite.AddTest("AtomicBasic", TestAtomicBasic);
testSuite.AddTest("AtomicAsm", TestAtomicAsm);
nErrorCount += testSuite.Run();
nErrorCount += EASTLTest_CheckMemory();
EA::EAMain::PlatformShutdown(nErrorCount);
return nErrorCount;
}
|