mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@8868 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
997bd2cced
commit
fb30543ab3
3 changed files with 73 additions and 0 deletions
58
autotest/initializer_list/initializer_list.cpp
Normal file
58
autotest/initializer_list/initializer_list.cpp
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#ifdef CPP_11
|
||||
|
||||
template <class T>
|
||||
void Test()
|
||||
{
|
||||
DLOG("--------------------------");
|
||||
DLOG(typeid(T).name());
|
||||
T v = { 1, 2, 3, 4 };
|
||||
DDUMP(v);
|
||||
v.Insert(1, { 11, 12 });
|
||||
DDUMP(v);
|
||||
v.Append({333});
|
||||
ASSERT(AsString(v) == "[1, 11, 12, 2, 3, 4, 333]");
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void Test2()
|
||||
{
|
||||
DLOG("--------------------------");
|
||||
DLOG(typeid(T).name());
|
||||
T v = { 1, 2, 3, 4 };
|
||||
DDUMP(v);
|
||||
ASSERT(AsString(v) == "[1, 2, 3, 4]");
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
Test<Vector<int>>();
|
||||
Test<Array<int>>();
|
||||
|
||||
Test2<InVector<int>>();
|
||||
Test2<Index<int>>();
|
||||
Test2<ArrayIndex<int>>();
|
||||
Test2<BiVector<int>>();
|
||||
Test2<BiArray<int>>();
|
||||
|
||||
// VectorTest<InVector<int>>();
|
||||
// VectorTest<InArray<
|
||||
DLOG("--------------------------");
|
||||
DLOG("Everything OK");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
DLOG("Not a C++11 compiler - test omitted");
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue