X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/ed3790564352540a939b50da90fa422db05f5a6e..03e6bac48b3be290deae9d8943940bf0067846af:/emufs/b_plus_test.c?ds=inline diff --git a/emufs/b_plus_test.c b/emufs/b_plus_test.c index 996603b..897d140 100644 --- a/emufs/b_plus_test.c +++ b/emufs/b_plus_test.c @@ -5,7 +5,8 @@ int main(int argc, char* argv[]) { /* Locals */ INDEX_DAT querydata; - +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; @@ -17,10 +18,33 @@ 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 = -666; +querydata.num_bloque = 9; querydata.clave.i_clave = 5; -emufs_b_plus_get_bloque(&indice,&querydata); +b_plus_insertar_clave(&indice,&querydata); + + +querydata.num_bloque = 2; +querydata.clave.i_clave = 4; +b_plus_insertar_clave(&indice,&querydata); + +querydata.num_bloque = 7; +querydata.clave.i_clave = 3; +b_plus_insertar_clave(&indice,&querydata); + +querydata.num_bloque = 5; +querydata.clave.i_clave = 2; +b_plus_insertar_clave(&indice,&querydata); +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); + printf("Claves:"); + for (i = 0; i < indice.size_claves/sizeof(int); ++i) printf(" %i",memnodo->claves[i]); + printf("\nHijos:"); + for (i = 0; i < indice.size_hijos/sizeof(int); ++i) printf(" %i",memnodo->hijos[i]); + printf("\nEnd Dump\n"); +free(memnodo); return 0; }