.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@9409 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-01-17 05:36:07 +00:00
parent ba5305ae72
commit 72a2b7816f
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,5 @@
description "#WAIT: 20\377";
uses
Core;

View file

@ -13,12 +13,16 @@ CONSOLE_APP_MAIN
LOG(i);
String a('x', Random(10));
String b('x', Random(10));
a << AsString(Random());
b << AsString(Random());
a << FormatIntBase(Random(), 2) << FormatIntBase(Random(), 2) << FormatIntBase(Random(), 2);
b << FormatIntBase(Random(), 2) << FormatIntBase(Random(), 2) << FormatIntBase(Random(), 2);
int n = min(a.GetLength(), b.GetLength());
ASSERT(sgn(fast_memcmp((byte *)~a, (byte *)~b, n)) == sgn(memcmp((byte *)~a, (byte *)~b, n)));
ASSERT(sgn(fast_memcmp(~a, ~b, n)) == sgn(memcmp(~a, ~b, n)));
ASSERT(sgn(a.Compare(b)) == sgn(strcmp(~a, ~b)));
ASSERT(sgn(a.Compare(a)) == 0);
}
LOG("------------ OK");