#include "../Util/Util.h" #include "KVstore.h" using namespace std; const int maxn=10000000; KVstore testkv; void generate_test_data() { FILE *data_file1=fopen("./data1","w"); FILE *data_file2=fopen("./data2","w"); fprintf(data_file1,"%d\n",maxn); fprintf(data_file2,"%d\n",maxn); for(int i=0;i '9') p++; line[i-3] = 0; i = atoi(p); return i; } int getMemkb(){ //Note: this value is in KB! FILE* file = fopen("/proc/self/status", "r"); int result = -1; char line[128]; while (fgets(line, 128, file) != NULL){ if (strncmp(line, "VmSize:", 7) == 0){ result = parseLine(line); break; } } fclose(file); return result; } //string2id void test_string2id_insert() { cout<< "testing string2id insert..." <