mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@13415 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
bbca078611
commit
3fa19cd66c
2 changed files with 44 additions and 0 deletions
35
autotest/ValueSortCompare/ValueSortCompare.cpp
Normal file
35
autotest/ValueSortCompare/ValueSortCompare.cpp
Normal 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");
|
||||
}
|
||||
9
autotest/ValueSortCompare/ValueSortCompare.upp
Normal file
9
autotest/ValueSortCompare/ValueSortCompare.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
ValueSortCompare.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue