still thinking through hashtable
This commit is contained in:
parent
6f65e4b424
commit
634a40c638
2 changed files with 19 additions and 8 deletions
|
|
@ -10,7 +10,7 @@
|
|||
//TODO: add hash function for testing
|
||||
|
||||
void TEST_Hashtable_PrintIter(void *key, void *value){
|
||||
printf("%s, %d\n", (char *)key, *(int32_t *)value);
|
||||
//printf("%s, %d\n", (char *)key, *(int32_t *)value);
|
||||
}
|
||||
|
||||
void TEST_Hashtable_Print(void *hashtable){
|
||||
|
|
@ -147,7 +147,7 @@ ARC_TEST(Hashtable_Add_Get_Remove_100){
|
|||
ARC_Hashtable_Create(&hashtable, NULL, &keyCompareFn, &destroyKeyValueFn);
|
||||
|
||||
const char *keyCStr = "key%03u";
|
||||
uint32_t maxVal = 1000;
|
||||
uint32_t maxVal = 15;
|
||||
|
||||
for(uint32_t index = 0; index < maxVal; index++){
|
||||
char *key = (char *)malloc(strlen(keyCStr));
|
||||
|
|
@ -172,6 +172,7 @@ ARC_TEST(Hashtable_Add_Get_Remove_100){
|
|||
char *key = (char *)malloc(strlen(keyCStr));
|
||||
sprintf(key, keyCStr, index);
|
||||
|
||||
TEST_Hashtable_Print(hashtable);
|
||||
ARC_Hashtable_Remove(hashtable, key);
|
||||
|
||||
free(key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue