X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/224194e18dce492ec2df32c6dd1f3b8d7290b4be..ddc964cd151aae4713a5d2d658da986df7cd3441:/emufs/b_plus_test.c diff --git a/emufs/b_plus_test.c b/emufs/b_plus_test.c index 897d140..72e2c83 100644 --- a/emufs/b_plus_test.c +++ b/emufs/b_plus_test.c @@ -9,19 +9,16 @@ NODO_B_PLUS *memnodo; int num_node, i; /* Creamos un handler EMUFS, luego un Indice B+ y testing... */ INDEXSPECS indice; -indice.tam_bloque = SIZE_B_PLUS_HEADER + sizeof(int)*4 + sizeof(int)*5; +indice.tam_bloque = SIZE_B_PLUS_HEADER + sizeof(int)*5 + sizeof(int)*6; indice.size_claves = (indice.tam_bloque - SIZE_B_PLUS_HEADER - sizeof(int))/2; indice.size_hijos = indice.size_claves + sizeof(int); 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); -/* Pedimos al arbol el nro de bloque donde guardar la clave 5. Should */ -/* return -1 pues solo esta la raiz.. */ querydata.num_bloque = 9; querydata.clave.i_clave = 5; b_plus_insertar_clave(&indice,&querydata); - querydata.num_bloque = 2; querydata.clave.i_clave = 4; @@ -35,6 +32,10 @@ querydata.num_bloque = 5; querydata.clave.i_clave = 2; b_plus_insertar_clave(&indice,&querydata); +querydata.num_bloque = 8; +querydata.clave.i_clave = 63; +b_plus_insertar_clave(&indice,&querydata); + num_node = 0; memnodo = b_plus_leer_nodo(&indice, num_node); printf("Dumping Node_%i\n",num_node); @@ -45,6 +46,10 @@ memnodo = b_plus_leer_nodo(&indice, num_node); for (i = 0; i < indice.size_hijos/sizeof(int); ++i) printf(" %i",memnodo->hijos[i]); printf("\nEnd Dump\n"); free(memnodo); + +querydata.num_bloque = 54; +querydata.clave.i_clave = 15; +b_plus_insertar(&indice, &querydata); return 0; }