comparison dowa/dowa_test.c @ 22:947b81010aba

[Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
author June Park <parkjune1995@gmail.com>
date Tue, 07 Oct 2025 07:11:02 -0700
parents 09def63429b9
children a30944e5719e
comparison
equal deleted inserted replaced
21:09def63429b9 22:947b81010aba
94 94
95 printf("=== Map2 (with arena) ===\n"); 95 printf("=== Map2 (with arena) ===\n");
96 Dowa_HashMap_Print(map2); 96 Dowa_HashMap_Print(map2);
97 97
98 Dowa_HashMap_Destroy(map2); 98 Dowa_HashMap_Destroy(map2);
99 printf("[Map2] destroyed (no change)\n\n");
99 Dowa_Arena_Destroy(mapArena); 100 Dowa_Arena_Destroy(mapArena);
100 printf("[Map2 & Arena] destroyed\n\n"); 101 printf("[Arena] destroyed (all null)\n\n");
101 102
102 // --- Test Cache_Folder --- 103 // --- Test Cache_Folder ---
103 // Ensure there is a directory "./dowa/test_folder" with some files for this test to succeed. 104 // Ensure there is a directory "./dowa/test_folder" with some files for this test to succeed.
104 int cache_result = Dowa_HashMap_Cache_Folder(map, "dowa/test_folder"); 105 int cache_result = Dowa_HashMap_Cache_Folder(map, "dowa/test_folder");
105 printf("[Cache_Folder] returned %d\n", cache_result); 106 printf("[Cache_Folder] returned %d\n", cache_result);
106 if (cache_result == 0) { 107 if (cache_result == 0)
108 {
107 printf("=== Map After Caching 'dowa/test_folder' ===\n"); 109 printf("=== Map After Caching 'dowa/test_folder' ===\n");
108 Dowa_HashMap_Print(map); 110 Dowa_HashMap_Print(map);
109 } else { 111 }else
112 {
110 printf("Cache_Folder failed (ensure 'dowa/test_folder' exists with files)\n"); 113 printf("Cache_Folder failed (ensure 'dowa/test_folder' exists with files)\n");
111 } 114 }
112 115
113 // Cleanup 116 // Cleanup
114 Dowa_HashMap_Destroy(map); 117 Dowa_HashMap_Destroy(map);