From c834f9edf3624a183af356aea23a949fd1d400fd Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 12 Apr 2014 12:26:36 +0000 Subject: [PATCH] .autotest git-svn-id: svn://ultimatepp.org/upp/trunk@7228 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- autotest/CallbackLambda/CallbackLambda.cpp | 20 +++++----- autotest/FormatUnsafe/FormatUnsafe.cpp | 45 ---------------------- autotest/FormatUnsafe/FormatUnsafe.upp | 9 ----- autotest/FormatUnsafe/init | 4 -- 4 files changed, 10 insertions(+), 68 deletions(-) delete mode 100644 autotest/FormatUnsafe/FormatUnsafe.cpp delete mode 100644 autotest/FormatUnsafe/FormatUnsafe.upp delete mode 100644 autotest/FormatUnsafe/init diff --git a/autotest/CallbackLambda/CallbackLambda.cpp b/autotest/CallbackLambda/CallbackLambda.cpp index 20a28281c..c1ec40e66 100644 --- a/autotest/CallbackLambda/CallbackLambda.cpp +++ b/autotest/CallbackLambda/CallbackLambda.cpp @@ -10,70 +10,70 @@ CONSOLE_APP_MAIN { Callback cb; - cb = [&] { a = 1; LOG("Callback"); }; + cb = lambda([&] { a = 1; LOG("Callback"); }); cb(); ASSERT(a == 1); } { Callback1 cb; - cb = [&](int b) { a = b; LOG("Callback1"); }; + cb = lambda([&](int b) { a = b; LOG("Callback1"); }); cb(123); ASSERT(a == 123); } { Callback2 cb; - cb = [&](int b, int c) { a = b + c; LOG("Callback2"); }; + cb = lambda([&](int b, int c) { a = b + c; LOG("Callback2"); }); cb(1, 20); ASSERT(a == 21); } { Callback3 cb; - cb = [&](int b, int c, int d) { a = b + c + d; LOG("Callback3"); }; + cb = lambda([&](int b, int c, int d) { a = b + c + d; LOG("Callback3"); }); cb(1, 20, 300); ASSERT(a == 321); } { Callback4 cb; - cb = [&](int b, int c, int d, int e) { a = b + c + d + e; LOG("Callback4"); }; + cb = lambda([&](int b, int c, int d, int e) { a = b + c + d + e; LOG("Callback4"); }); cb(1, 20, 300, 4000); ASSERT(a == 4321); } { Gate cb; - cb = [&] { a = 1; LOG("Gate"); return true; }; + cb = lambda([&] { a = 1; LOG("Gate"); return true; }); ASSERT(cb()); ASSERT(a == 1); } { Gate1 cb; - cb = [&](int b) { a = b; LOG("Gate1"); return false; }; + cb = lambda([&](int b) { a = b; LOG("Gate1"); return false; }); ASSERT(!cb(123)); ASSERT(a == 123); } { Gate2 cb; - cb = [&](int b, int c) { a = b + c; LOG("Gate2"); return true; }; + cb = lambda([&](int b, int c) { a = b + c; LOG("Gate2"); return true; }); ASSERT(cb(1, 20)); ASSERT(a == 21); } { Gate3 cb; - cb = [&](int b, int c, int d) { a = b + c + d; LOG("Gate3"); return true; }; + cb = lambda([&](int b, int c, int d) { a = b + c + d; LOG("Gate3"); return true; }); ASSERT(cb(1, 20, 300)); ASSERT(a == 321); } { Gate4 cb; - cb = [&](int b, int c, int d, int e) { a = b + c + d + e; LOG("Gate4"); return true; }; + cb = lambda([&](int b, int c, int d, int e) { a = b + c + d + e; LOG("Gate4"); return true; }); ASSERT(cb(1, 20, 300, 4000)); ASSERT(a == 4321); } diff --git a/autotest/FormatUnsafe/FormatUnsafe.cpp b/autotest/FormatUnsafe/FormatUnsafe.cpp deleted file mode 100644 index 5ccc47da2..000000000 --- a/autotest/FormatUnsafe/FormatUnsafe.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include - -using namespace Upp; - -CONSOLE_APP_MAIN -{ - StdLogSetup(LOG_COUT|LOG_FILE); - String rndset; - rndset << "[]<>;`%%%%"; - rndset << rndset; - rndset << rndset; - rndset << rndset; - for(int i = 32; i < 128; i++) - if(IsAlpha(i) || IsDigit(i)) - rndset.Cat(i); - SeedRandom(); - int time0 = msecs(); - while(msecs(time0) < 150000) { - String fmtstr; - while(Random(20)) - fmtstr << (char)rndset[Random(rndset.GetCount())]; - Vector v; - for(;;) { - int q = Random(5); - if(q == 0) - break; - switch(q) { - case 1: - v.Add((int)Random(100)); - break; - case 2: - v.Add(AsString(Random(100))); - break; - case 3: - v.Add(GetSysDate() + Random(100)); - break; - } - } - DUMP(fmtstr); - DUMP(v); - DUMP(NFormat(fmtstr, v)); - } - - LOG("============ OK"); -} diff --git a/autotest/FormatUnsafe/FormatUnsafe.upp b/autotest/FormatUnsafe/FormatUnsafe.upp deleted file mode 100644 index f39bb30c0..000000000 --- a/autotest/FormatUnsafe/FormatUnsafe.upp +++ /dev/null @@ -1,9 +0,0 @@ -uses - Core; - -file - FormatUnsafe.cpp; - -mainconfig - "" = "SSE2"; - diff --git a/autotest/FormatUnsafe/init b/autotest/FormatUnsafe/init deleted file mode 100644 index 225b8913a..000000000 --- a/autotest/FormatUnsafe/init +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _FormatUnsafe_icpp_init_stub -#define _FormatUnsafe_icpp_init_stub -#include "Core/init" -#endif