still working on hashtable remove
This commit is contained in:
parent
7977555021
commit
262e6ef9de
2 changed files with 31 additions and 43 deletions
|
|
@ -148,12 +148,12 @@ ARC_TEST(Hashtable_Add_Get_Remove_100){
|
|||
ARC_Hashtable_DestroyKeyValueFn destroyKeyValueFn = TEST_Hashtable_DestroyKeyValueFn;
|
||||
ARC_Hashtable_Create(&hashtable, NULL, &keyCompareFn, &destroyKeyValueFn);
|
||||
|
||||
const char *keyCStr = "key%03u";
|
||||
const char *keyCStr = "key%09u";
|
||||
uint32_t tempMaxVal = 10000;
|
||||
|
||||
for(uint32_t maxVal = 0; maxVal < tempMaxVal; maxVal++){
|
||||
for(uint32_t index = 0; index < maxVal; index++){
|
||||
char *key = (char *)malloc(strlen(keyCStr));
|
||||
char *key = (char *)malloc(strlen(keyCStr) + 12);
|
||||
sprintf(key, keyCStr, index);
|
||||
|
||||
int32_t *val = (int32_t *)malloc(sizeof(int32_t));
|
||||
|
|
@ -163,7 +163,7 @@ ARC_TEST(Hashtable_Add_Get_Remove_100){
|
|||
}
|
||||
|
||||
for(uint32_t index = 0; index < maxVal; index++){
|
||||
char *key = (char *)malloc(strlen(keyCStr));
|
||||
char *key = (char *)malloc(strlen(keyCStr) + 12);
|
||||
sprintf(key, keyCStr, index);
|
||||
|
||||
ARC_CHECK(index == *(int32_t *)ARC_Hashtable_Get(hashtable, key));
|
||||
|
|
@ -172,7 +172,7 @@ ARC_TEST(Hashtable_Add_Get_Remove_100){
|
|||
}
|
||||
|
||||
for(uint32_t index = 0; index < maxVal; index++){
|
||||
char *key = (char *)malloc(strlen(keyCStr));
|
||||
char *key = (char *)malloc(strlen(keyCStr) + 12);
|
||||
sprintf(key, keyCStr, index);
|
||||
|
||||
TEST_Hashtable_Print(hashtable);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue