.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@13390 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-06-14 08:20:44 +00:00
parent 5656bb4d01
commit 485415b8dd
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
StdLogSetup(LOG_COUT|LOG_FILE);
for(int i = -1; i < 64; i++) {
uint64 v = i >= 0 ? (uint64)1 << i : 0;
LOG("===============");
DUMPHEX(v);
DUMP(SignificantBits64(v));
DUMP(SignificantBits(v));
if(i < 32)
ASSERT(SignificantBits((dword)v) == i + 1);
ASSERT(SignificantBits64(v) == i + 1);
}
LOG("================= OK");
}

View file

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