- Adjusted some tests while debugging PrettyPrinters

- Adjusted RDTreePrinter to print more "tree-like"
 - Added SetPrinter and MapPrinter
 - Fixed Issues with CStringPrinter and StringPrinter
This commit is contained in:
2025-08-10 00:27:04 -04:00
parent d2be083a8f
commit 9f96155856
13 changed files with 188 additions and 43 deletions

View File

@@ -31,10 +31,8 @@ namespace fennec::test
const char string[] = "Hello World!";
array<char, sizeof(string)> arr1;
array<char, sizeof(string)> arr2;
std::array<char, sizeof(string)> stdarr;
strcpy(&arr1[0], string);
strcpy(&arr2[0], string);
strcpy(&stdarr[0], string);
fennec_test_run(strcmp(&arr1[0], string), 0);
fennec_test_run(strcmp(&arr2[0], string), 0);

View File

@@ -31,7 +31,7 @@ namespace fennec::test
dynarray<int> test1;
dynarray<int> test2;
int n = 10000;
int n = 50;
for (int i = 0; i < n; ++i) {
test1.push_back(i);
test2.push_back(n - i - 1);

View File

@@ -33,7 +33,7 @@ inline void fennec_test_containers_list() {
list<size_t> test;
const size_t n = 10000;
const size_t n = 50;
for (size_t i = 0; i < n; ++i) {
const size_t p = rand() % (i + 1);
assertf(test.insert(p, i) == i, "List Construct Test Failed.");

View File

@@ -33,7 +33,7 @@ inline void fennec_test_containers_rdtree() {
rdtree<size_t> test;
const size_t n = 10000;
const size_t n = 50;
for (size_t i = 0; i < n; ++i) {
const size_t parent = rand() % (i + 1);
const size_t child = rdtree<size_t>::npos;

View File

@@ -31,18 +31,19 @@ namespace fennec::test
inline void fennec_test_containers_set() {
using type_t = decltype(rand());
std::unordered_set<type_t> ref;
list<type_t> ref;
set<type_t> test;
srand(0);
for (int i = 0; i < 10000; ++i) {
int n = 50;
for (int i = 0; i < n; ++i) {
type_t v = rand();
ref.insert(v);
test.insert(v);
ref.push_back(v);
}
for (int i = 0; i < 10000; ++i) {
assertf(ref.contains(i) == test.contains(i), "set test failed");
for (int i = 0; i < n; ++i) {
type_t v = ref[i];
assertf(test.contains(v), "set test failed");
}
std::cout << "passed" << std::endl;