From: Philippe E. <ph...@us...> - 2002-04-15 19:40:17
|
Update of /cvsroot/oprofile/oprofile-tests/db In directory usw-pr-cvs1:/tmp/cvs-serv23396 Modified Files: db-manage.c db-test.c Log Message: valgrind test Index: db-manage.c =================================================================== RCS file: /cvsroot/oprofile/oprofile-tests/db/db-manage.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- db-manage.c 15 Apr 2002 19:13:00 -0000 1.3 +++ db-manage.c 15 Apr 2002 19:40:12 -0000 1.4 @@ -14,7 +14,7 @@ unsigned int old_size = root->size; unsigned int pos; -#if 0 +#if 1 root->size = root->size ? root->size * 2 : 1; root->base_area = realloc(root->base_area, root->size * sizeof(page_t)); @@ -33,11 +33,13 @@ PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); } - printf("%p %d\n", root->base_area, root->size); if (root->base_area == MAP_FAILED) { printf("%s\n", strerror(errno)); exit(1); } + + memset(&root->base_area[old_size], '\0', + (old_size == 0 ? 1 : old_size) * sizeof(page_t)); #endif for (pos = old_size ; pos < root->size ; ++pos) { @@ -48,15 +50,12 @@ * page_nr_to_page_ptr can trigger an assertion ! */ page = &root->base_area[pos]; // page = page_nr_to_page_ptr(root, pos); - printf("pos %d\n", pos); page->p0 = nil_page; for (count = 0 ; count < MAX_PAGE ; ++count) { page->page_table[count].child_page = nil_page; } } } - - printf("return %d\n", root->current_size); return (page_idx_t)root->current_size++; } Index: db-test.c =================================================================== RCS file: /cvsroot/oprofile/oprofile-tests/db/db-test.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- db-test.c 15 Apr 2002 04:20:32 -0000 1.3 +++ db-test.c 15 Apr 2002 19:40:12 -0000 1.4 @@ -69,7 +69,7 @@ int i, j; for (i = 1000 ; i <= 1000000 ; i *= 10) { - for (j = 100 ; j <= i / 10 ; j *= 10) { + for (j = 100 ; j <= i / 1 ; j+=1) { if (test(i, j)) { printf("%s:%d failure for %d %d\n", __FILE__, __LINE__, i, j); |