- columns = 4;
- elements = 20;
- ht = ston_ht32_new(columns,elements,0,malloc);
- check_ht(ht);
- printf("Filling hashtable with entries\n");
- for(key = 0xCEED; elements--; key *= 7)
- { val[0] = key;
- for(i = 1; i < columns; i++)
- val[i] = i * key;
- ston_ht32_insertx(ht,key,val,0,columns);
- }
- printf("Reading entries\n");
- elements = 20;
- for(key = 0xCEED; elements--; key *= 7)
- { htval = ston_ht32_row(ht,key);
- printf("[%s%x"CLRC"]",(*htval == key) ? GREEN : RED,*htval);
- for(i = 1; i < columns; i++)
- printf("[%s%x"CLRC"]",(htval[i] == (uint32_t)(i * key)) ? GREEN : RED,htval[i]);
- putchar('\n');
- }
- int max_capacity = ston_up2pow(20 << 1) - 20;
- printf("Overfilling hashtable with %i entries\n", max_capacity);
- int cap = max_capacity;
- for(key = 0xCEED2; cap--; key *= 13)
- { val[0] = key;
- for(i = 1; i < columns; i++)
- val[i] = key * -i;
- ston_ht32_insertx(ht,key,val,0,columns);
- }
- printf("Reading entries\n");
- cap = max_capacity;
- for(key = 0xCEED2; cap--; key *= 13)
- { htval = ston_ht32_row(ht,key);
- printf("[%s%x"CLRC"]",(*htval == key) ? GREEN : RED,*htval);
- for(i = 1; i < columns; i++)
- printf("[%s%x"CLRC"]",(htval[i] == (uint32_t)(key * -i)) ? GREEN : RED,htval[i]);
- printf("\n");
- }
+ /* printf("\nHuge usage:\n"); */
+ /* do_test(2,100000000,ht,free,ston_ht32_new(2,100000000,0,malloc),ston_ht32_insertx,ston_ht32_row,0xCEED); */
+ /* do_test(2,100000000,dht,ston_dht_free,ston_dht32_new(2,malloc,free),ston_dht32_insertx,ston_dht32_row,0xCEED); */