From c6c2439cf32a87e1b7fbf86bbcaa96be23f886da Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 2 May 2020 08:58:56 +0000 Subject: [PATCH] .autotest git-svn-id: svn://ultimatepp.org/upp/trunk@14421 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- autotest/CoFindAll/CoFindAll.cpp | 9 +++++++-- autotest/Heap/Heap.cpp | 3 +++ autotest/HeapCheck/HeapCheck.cpp | 4 ++++ autotest/HeapMT2/HeapMT2.cpp | 4 ++++ autotest/InArray/InArray.cpp | 5 +++++ autotest/Index2/Index2.cpp | 4 ++++ autotest/Lalloc/Lalloc.cpp | 7 ++++++- autotest/RangeInsertTest/RangeInsertTest.cpp | 9 +++++++-- autotest/SortedIndex/SortedIndex.cpp | 7 ++++++- autotest/Stream64PutGet/Stream64PutGet.cpp | 4 ++++ autotest/String/String.cpp | 4 ++++ autotest/StringCompare/StringCompare.cpp | 4 ++++ autotest/fast_memcmp/fast_memcmp.cpp | 4 ++++ 13 files changed, 62 insertions(+), 6 deletions(-) diff --git a/autotest/CoFindAll/CoFindAll.cpp b/autotest/CoFindAll/CoFindAll.cpp index 1f7d098d9..52789a85e 100644 --- a/autotest/CoFindAll/CoFindAll.cpp +++ b/autotest/CoFindAll/CoFindAll.cpp @@ -9,8 +9,13 @@ CONSOLE_APP_MAIN StdLogSetup(LOG_COUT|LOG_FILE); SeedRandom(); - - for(int ii = 0; ii < 200; ii++) { + +#ifdef CPU_ARM + for(int ii = 0; ii < 10; ii++) +#else + for(int ii = 0; ii < 200; ii++) +#endif + { DUMP(ii); int N = Random(20000000); int mod = 6 * Random(50000) + 1; diff --git a/autotest/Heap/Heap.cpp b/autotest/Heap/Heap.cpp index a57784b8d..cddf7abf2 100644 --- a/autotest/Heap/Heap.cpp +++ b/autotest/Heap/Heap.cpp @@ -65,6 +65,9 @@ int RndSize() void HeapTest(int cnt, int N, bool chk) { +#ifdef CPU_ARM + N = N / 20; +#endif int mask = cnt - 1; count = cnt; memset(ptr, 0, sizeof(ptr)); diff --git a/autotest/HeapCheck/HeapCheck.cpp b/autotest/HeapCheck/HeapCheck.cpp index f75194a73..35b92303c 100644 --- a/autotest/HeapCheck/HeapCheck.cpp +++ b/autotest/HeapCheck/HeapCheck.cpp @@ -2,7 +2,11 @@ using namespace Upp; +#ifdef CPU_ARM +#define N 5000 +#else #define N 100000 +#endif #define LLOG(x) // LOG(x) diff --git a/autotest/HeapMT2/HeapMT2.cpp b/autotest/HeapMT2/HeapMT2.cpp index 8deeb3bac..763b67a00 100644 --- a/autotest/HeapMT2/HeapMT2.cpp +++ b/autotest/HeapMT2/HeapMT2.cpp @@ -1,6 +1,10 @@ #include +#ifdef CPU_ARM +#define N 1000 * 5 +#else #define N 1000 * 100 +#endif #define THREADS 5 diff --git a/autotest/InArray/InArray.cpp b/autotest/InArray/InArray.cpp index 67ccd16fb..dc1f0620b 100644 --- a/autotest/InArray/InArray.cpp +++ b/autotest/InArray/InArray.cpp @@ -8,6 +8,11 @@ using namespace Upp; #define N 20 #endif +#ifdef CPU_ARM +#undef N +#define N 1 +#endif + template void Compare(C1& a, C2& b) { diff --git a/autotest/Index2/Index2.cpp b/autotest/Index2/Index2.cpp index 06db8eca7..13602c5d7 100644 --- a/autotest/Index2/Index2.cpp +++ b/autotest/Index2/Index2.cpp @@ -274,6 +274,10 @@ void CarpetBombing() int Q = 20; int COUNT = 10000000; +#ifdef CPU_ARM + COUNT /= 20; +#endif + for(int i = 0; i < COUNT; i++) { if(i % 100000 == 0) diff --git a/autotest/Lalloc/Lalloc.cpp b/autotest/Lalloc/Lalloc.cpp index 89b8fbf36..dbb3685b3 100644 --- a/autotest/Lalloc/Lalloc.cpp +++ b/autotest/Lalloc/Lalloc.cpp @@ -9,7 +9,12 @@ CONSOLE_APP_MAIN StdLogSetup(LOG_COUT|LOG_FILE); SeedRandom(0); PeakMemoryProfile(); - for(int i = 0; i < 100000000; i++) { +#ifdef CPU_ARM + for(int i = 0; i < 5000000; i++) +#else + for(int i = 0; i < 100000000; i++) +#endif + { if(i % 10000 == 0) DLOG(i); int ii = Random(1000); diff --git a/autotest/RangeInsertTest/RangeInsertTest.cpp b/autotest/RangeInsertTest/RangeInsertTest.cpp index c18e7bc2f..f61e04e72 100644 --- a/autotest/RangeInsertTest/RangeInsertTest.cpp +++ b/autotest/RangeInsertTest/RangeInsertTest.cpp @@ -12,8 +12,13 @@ CONSOLE_APP_MAIN Array a; InVector iv; InArray av; - - for(int i = 0; i < 10000; i++) { + +#ifdef CPU_ARM + for(int i = 0; i < 500; i++) +#else + for(int i = 0; i < 10000; i++) +#endif + { if(v.GetCount() > 100000) { int pos = Random(v.GetCount() + 1); int count = Random(v.GetCount() - pos); diff --git a/autotest/SortedIndex/SortedIndex.cpp b/autotest/SortedIndex/SortedIndex.cpp index d4c403df9..dd837084e 100644 --- a/autotest/SortedIndex/SortedIndex.cpp +++ b/autotest/SortedIndex/SortedIndex.cpp @@ -22,7 +22,12 @@ CONSOLE_APP_MAIN LOG("FindAdd passed"); SortedIndex si; int count = 0; - for(int i = 0; i < 1000000; i++) { +#ifdef CPU_ARM + for(int i = 0; i < 100000; i++) +#else + for(int i = 0; i < 1000000; i++) +#endif + { if(i % 1000 == 0) LOG(i); if(si.GetCount() > 1000 && Random(1000) == 0) { diff --git a/autotest/Stream64PutGet/Stream64PutGet.cpp b/autotest/Stream64PutGet/Stream64PutGet.cpp index 49f438fc0..c72ef6b43 100644 --- a/autotest/Stream64PutGet/Stream64PutGet.cpp +++ b/autotest/Stream64PutGet/Stream64PutGet.cpp @@ -5,7 +5,11 @@ using namespace Upp; CONSOLE_APP_MAIN { StdLogSetup(LOG_FILE|LOG_COUT); +#ifdef CPU_64 const int64 sz = (int64)2 * 1000 * 1000 * 1000; +#else + const int64 sz = (int64)1000 * 1000 * 1000; +#endif String path = GetHomeDirFile("test.bin"); { Buffer big(sz); diff --git a/autotest/String/String.cpp b/autotest/String/String.cpp index 275f15a34..d091d37a7 100644 --- a/autotest/String/String.cpp +++ b/autotest/String/String.cpp @@ -10,7 +10,11 @@ using namespace Upp; #define N 5 #endif +#ifdef CPU_ARM +#define STEPS 40000 * N +#else #define STEPS 400000 * N +#endif namespace Upp { typedef wchar *HT; diff --git a/autotest/StringCompare/StringCompare.cpp b/autotest/StringCompare/StringCompare.cpp index 88bf350bf..b9be9f978 100644 --- a/autotest/StringCompare/StringCompare.cpp +++ b/autotest/StringCompare/StringCompare.cpp @@ -5,7 +5,11 @@ using namespace Upp; +#ifdef CPU_ARM +#define N 2000000 +#else #define N 10000000 +#endif int RandomChar() { diff --git a/autotest/fast_memcmp/fast_memcmp.cpp b/autotest/fast_memcmp/fast_memcmp.cpp index d4d493678..2320b3013 100644 --- a/autotest/fast_memcmp/fast_memcmp.cpp +++ b/autotest/fast_memcmp/fast_memcmp.cpp @@ -2,7 +2,11 @@ using namespace Upp; +#ifdef CPU_ARM +#define N 1000000 +#else #define N 10000000 +#endif CONSOLE_APP_MAIN {