.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@13415 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-06-18 11:44:14 +00:00
parent bbca078611
commit 3fa19cd66c
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,35 @@
#include <Core/Core.h>
using namespace Upp;
void Test(Vector<Value>& h)
{
Sort(h);
for(int i = 0; i < h.GetCount() - 1; i++)
ASSERT(h[i] <= h[i + 1]);
}
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
Vector<Value> vi, vf, vd, vt, vi64, vs;
SeedRandom(0);
for(int i = 0; i < 10000; i++) {
vi.Add((int)Random());
vf.Add(Randomf());
vi64.Add((int64)Random64());
vt.Add(GetSysTime() + (int64)Random64());
vd.Add(GetSysDate() + Random());
vs.Add(AsString(Random()));
}
Test(vi);
Test(vf);
Test(vi64);
Test(vs);
Test(vd);
Test(vt);
LOG("============ OK");
}

View file

@ -0,0 +1,9 @@
uses
Core;
file
ValueSortCompare.cpp;
mainconfig
"" = "";