From a8f3ab257fed45ab143e3231e49ee07082735862 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Mon, 12 Feb 2024 12:13:56 +0100 Subject: [PATCH] .autotest --- autotest/VectorSet/VectorSet.cpp | 30 ++++++++++++++++++++++++++++++ autotest/VectorSet/VectorSet.upp | 9 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 autotest/VectorSet/VectorSet.cpp create mode 100644 autotest/VectorSet/VectorSet.upp diff --git a/autotest/VectorSet/VectorSet.cpp b/autotest/VectorSet/VectorSet.cpp new file mode 100644 index 000000000..406d5b314 --- /dev/null +++ b/autotest/VectorSet/VectorSet.cpp @@ -0,0 +1,30 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + Vector h; + Vector H; + + for(int i = 0; i < 10000; i++) { + if(Random(100) == 0) { + h.Clear(); + H.Clear(); + } + int from = Random(h.GetCount() + 10); + String what = AsString(i); + int count = Random(20); + + h.Set(from, what, count); + for(int i = 0; i < count; i++) + H.At(i + from) = what; + + if(i < 100) { + DDUMP(h); + DDUMP(H); + } + + ASSERT(H == h); + } +} diff --git a/autotest/VectorSet/VectorSet.upp b/autotest/VectorSet/VectorSet.upp new file mode 100644 index 000000000..f1e083275 --- /dev/null +++ b/autotest/VectorSet/VectorSet.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + VectorSet.cpp; + +mainconfig + "" = ""; +