mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@13390 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5656bb4d01
commit
485415b8dd
2 changed files with 30 additions and 0 deletions
21
autotest/SignificantBits/SignificantBits.cpp
Normal file
21
autotest/SignificantBits/SignificantBits.cpp
Normal 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");
|
||||
}
|
||||
9
autotest/SignificantBits/SignificantBits.upp
Normal file
9
autotest/SignificantBits/SignificantBits.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
SignificantBits.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue