From f3cdb2badb1be18569895c6ac8d976e8476a9da9 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 6 Aug 2014 15:50:48 +0000 Subject: [PATCH] .autotest git-svn-id: svn://ultimatepp.org/upp/trunk@7570 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- autotest/Algo/Algo.cpp | 17 +++++++++++++++++ autotest/Algo/Algo.upp | 9 +++++++++ autotest/Algo/init | 4 ++++ 3 files changed, 30 insertions(+) create mode 100644 autotest/Algo/Algo.cpp create mode 100644 autotest/Algo/Algo.upp create mode 100644 autotest/Algo/init diff --git a/autotest/Algo/Algo.cpp b/autotest/Algo/Algo.cpp new file mode 100644 index 000000000..d1491079d --- /dev/null +++ b/autotest/Algo/Algo.cpp @@ -0,0 +1,17 @@ +#include + +using namespace Upp; + +#define Check(a, b) if(a != b) { DLOG(#a << "=" << a << " != " << b); NEVER(); } + +CONSOLE_APP_MAIN +{ + Vector 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); +} diff --git a/autotest/Algo/Algo.upp b/autotest/Algo/Algo.upp new file mode 100644 index 000000000..7c7cbaeea --- /dev/null +++ b/autotest/Algo/Algo.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + Algo.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/autotest/Algo/init b/autotest/Algo/init new file mode 100644 index 000000000..fecad1def --- /dev/null +++ b/autotest/Algo/init @@ -0,0 +1,4 @@ +#ifndef _Algo_icpp_init_stub +#define _Algo_icpp_init_stub +#include "Core/init" +#endif