mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@10411 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7620412a04
commit
213e33b119
3 changed files with 37 additions and 0 deletions
4
autotest/util_fn/init
Normal file
4
autotest/util_fn/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _util_fn_icpp_init_stub
|
||||
#define _util_fn_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
24
autotest/util_fn/util_fn.cpp
Normal file
24
autotest/util_fn/util_fn.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_COUT|LOG_FILE);
|
||||
|
||||
ASSERT(min(4, 76, 8, 23, 5, 7, 3, 1, 7, 34, 8, 4345, 76, 7, 3) == 1);
|
||||
ASSERT(max(4, 76, 8, 23, 5, 7, 3, 1, 7, 34, 8, 4345, 76, 7, 3) == 4345);
|
||||
ASSERT(clamp(0, 1, 10) == 1);
|
||||
ASSERT(clamp(1, 1, 10) == 1);
|
||||
ASSERT(clamp(5, 1, 10) == 5);
|
||||
ASSERT(clamp(10, 1, 10) == 10);
|
||||
ASSERT(clamp(11, 1, 10) == 10);
|
||||
|
||||
ASSERT(findarg(4, 0, 1, 2, 3, 4, 5, 6, 7) == 4);
|
||||
ASSERT(findarg(8, 0, 1, 2, 3, 4, 5, 6, 7) == -1);
|
||||
|
||||
ASSERT(decode(4, 0, 10, 1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 16) == 14);
|
||||
ASSERT(decode(20, 0, 10, 1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 16) == 16);
|
||||
|
||||
LOG("=================== OK");
|
||||
}
|
||||
9
autotest/util_fn/util_fn.upp
Normal file
9
autotest/util_fn/util_fn.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
util_fn.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue