ultimatepp/autotest/ValueSortCompare/ValueSortCompare.cpp
cxl 3fa19cd66c .autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@13415 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2019-06-18 11:44:14 +00:00

35 lines
626 B
C++

#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");
}