- Fixed some missing and erroneous testing logic for containers
- Lots of bug-fixing for containers - Performance optimization for containers
This commit is contained in:
@@ -39,17 +39,29 @@ namespace test
|
||||
{
|
||||
|
||||
inline void fennec_test_containers_sequence() {
|
||||
dynarray<size_t> ref;
|
||||
sequence<size_t> test;
|
||||
using type_t = decltype(rand());
|
||||
dynarray<type_t> ref;
|
||||
sequence<type_t> test;
|
||||
const size_t n = 50;
|
||||
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
size_t v = rand();
|
||||
type_t v = rand();
|
||||
ref.push_back(v);
|
||||
test.insert(v);
|
||||
}
|
||||
|
||||
for (size_t v : ref) {
|
||||
fennec_test_run(test.size(), n);
|
||||
|
||||
type_t p = -1;
|
||||
size_t c = 0;
|
||||
for (type_t x : test) {
|
||||
assertf(x > p, "Failed Sequence Test!");
|
||||
p = x;
|
||||
++c;
|
||||
}
|
||||
fennec_test_run(c, n);
|
||||
|
||||
for (type_t v : ref) {
|
||||
assertf(test.contains(v), "Failed Sequence Test!");
|
||||
test.erase(v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user