- Adjusted Formatting of tests
- Finished map implementation and unit tests TODO: Threading
This commit is contained in:
@@ -25,34 +25,29 @@
|
||||
#include <unordered_set>
|
||||
#include <fennec/containers/set.h>
|
||||
|
||||
namespace fennec
|
||||
namespace fennec::test
|
||||
{
|
||||
|
||||
namespace test
|
||||
{
|
||||
inline void fennec_test_containers_set() {
|
||||
|
||||
inline void fennec_test_containers_set() {
|
||||
using type_t = decltype(rand());
|
||||
std::unordered_set<type_t> ref;
|
||||
set<type_t> test;
|
||||
|
||||
using type_t = decltype(rand());
|
||||
std::unordered_set<type_t> ref;
|
||||
set<type_t> test;
|
||||
srand(0);
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
type_t v = rand();
|
||||
ref.insert(v);
|
||||
test.insert(v);
|
||||
}
|
||||
|
||||
srand(0);
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
type_t v = rand();
|
||||
ref.insert(v);
|
||||
test.insert(v);
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
assertf(ref.contains(i) == test.contains(i), "set test failed");
|
||||
}
|
||||
|
||||
std::cout << "passed" << std::endl;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
assertf(ref.contains(i) == test.contains(i), "set test failed");
|
||||
}
|
||||
|
||||
std::cout << "passed" << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // FENNEC_TEST_CONTAINERS_SET_H
|
||||
|
||||
Reference in New Issue
Block a user