X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/1103650bf8099a104304d123a1e36c30d537e462..c162dfe2758a5908e7340d119af97bda75a91201:/emufs/b_plus_test.c?ds=sidebyside diff --git a/emufs/b_plus_test.c b/emufs/b_plus_test.c index 72e2c83..3facd83 100644 --- a/emufs/b_plus_test.c +++ b/emufs/b_plus_test.c @@ -5,8 +5,8 @@ int main(int argc, char* argv[]) { /* Locals */ INDEX_DAT querydata; -NODO_B_PLUS *memnodo; -int num_node, i; +/*NODO_B_PLUS *memnodo;*/ +int i; /* Creamos un handler EMUFS, luego un Indice B+ y testing... */ INDEXSPECS indice; indice.tam_bloque = SIZE_B_PLUS_HEADER + sizeof(int)*5 + sizeof(int)*6; @@ -16,27 +16,32 @@ indice.filename = "idxbplus_primary.idx"; printf("\nTam Nodo: %i Size Claves: %i Size_Hijos: %i\n",indice.tam_bloque,indice.size_claves,indice.size_hijos); emufs_b_plus_crear(&indice); -querydata.num_bloque = 9; -querydata.clave.i_clave = 5; -b_plus_insertar_clave(&indice,&querydata); - + +for (i=1;i<34;++i) +{ +querydata.num_bloque = i; +querydata.clave.i_clave = i; +b_plus_insertar(&indice,&querydata); +} + +/* querydata.num_bloque = 2; -querydata.clave.i_clave = 4; -b_plus_insertar_clave(&indice,&querydata); +querydata.clave.i_clave = 7; +b_plus_insertar(&indice,&querydata); querydata.num_bloque = 7; -querydata.clave.i_clave = 3; -b_plus_insertar_clave(&indice,&querydata); +querydata.clave.i_clave = 5; +b_plus_insertar(&indice,&querydata); querydata.num_bloque = 5; -querydata.clave.i_clave = 2; -b_plus_insertar_clave(&indice,&querydata); +querydata.clave.i_clave = 3; +b_plus_insertar(&indice,&querydata); querydata.num_bloque = 8; querydata.clave.i_clave = 63; -b_plus_insertar_clave(&indice,&querydata); +b_plus_insertar(&indice,&querydata); -num_node = 0; +/*num_node = 0; memnodo = b_plus_leer_nodo(&indice, num_node); printf("Dumping Node_%i\n",num_node); printf("Nivel: %i Cant Claves: %i\n",memnodo->nivel,memnodo->cant_claves); @@ -45,11 +50,27 @@ memnodo = b_plus_leer_nodo(&indice, num_node); printf("\nHijos:"); for (i = 0; i < indice.size_hijos/sizeof(int); ++i) printf(" %i",memnodo->hijos[i]); printf("\nEnd Dump\n"); -free(memnodo); - +free(memnodo);*/ + /* querydata.num_bloque = 54; -querydata.clave.i_clave = 15; +querydata.clave.i_clave = 1; +b_plus_insertar(&indice, &querydata); + +querydata.num_bloque = 12; +querydata.clave.i_clave = 2; +b_plus_insertar(&indice, &querydata); + +querydata.num_bloque = 14; +querydata.clave.i_clave = 0; b_plus_insertar(&indice, &querydata); + +querydata.num_bloque = 22; +querydata.clave.i_clave = 4; +b_plus_insertar(&indice, &querydata); + +/*querydata.num_bloque = 6; +querydata.clave.i_clave = 100; +b_plus_insertar(&indice, &querydata);*/ return 0; }