diff --git a/autotest/Bits/Bits.cpp b/autotest/Bits/Bits.cpp new file mode 100644 index 000000000..cdeff97c7 --- /dev/null +++ b/autotest/Bits/Bits.cpp @@ -0,0 +1,24 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + StdLogSetup(LOG_COUT|LOG_FILE); + + Bits h; + Vector v; + + for(int i = 0; i < 100000; i++) { + int pos = Random(120000); + bool b = Random() & 1; + + v.At(pos, false) = b; + h.Set(pos, b); + } + + for(int i = 0; i < v.GetCount(); i++) + ASSERT(h.Get(i) == v[i]); + + LOG("--------- OK"); +} diff --git a/autotest/Bits/Bits.upp b/autotest/Bits/Bits.upp new file mode 100644 index 000000000..2c76592f1 --- /dev/null +++ b/autotest/Bits/Bits.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + Bits.cpp; + +mainconfig + "" = ""; +