.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@8868 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-08-30 06:30:34 +00:00
parent 997bd2cced
commit fb30543ab3
3 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,4 @@
#ifndef _initializer_list_icpp_init_stub
#define _initializer_list_icpp_init_stub
#include "Core/init"
#endif

View 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

View file

@ -0,0 +1,11 @@
description "C++ 11 std::initializer_list tests\377";
uses
Core;
file
initializer_list.cpp;
mainconfig
"" = "";