.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@7570 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-08-06 15:50:48 +00:00
parent d6a1f1e383
commit f3cdb2badb
3 changed files with 30 additions and 0 deletions

17
autotest/Algo/Algo.cpp Normal file
View file

@ -0,0 +1,17 @@
#include <Core/Core.h>
using namespace Upp;
#define Check(a, b) if(a != b) { DLOG(#a << "=" << a << " != " << b); NEVER(); }
CONSOLE_APP_MAIN
{
Vector<int> x;
x << 1 << 5 << 4 << 3 << 2 << 10;
// 0 1 2 3 4 5
Check(FindMin(x, 0, 2), 0);
Check(FindMax(x, 0, 3), 1);
Check(FindMax(x, 2, 3), 2);
Check(FindMax(x, 2, 4), 5);
Check(FindMin(x, 2, 4), 4);
}

9
autotest/Algo/Algo.upp Normal file
View file

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

4
autotest/Algo/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _Algo_icpp_init_stub
#define _Algo_icpp_init_stub
#include "Core/init"
#endif