mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
Addresses #1305
Port test to windows (took large stack item and made it static) Added debugging info for verbose mode git-svn-id: file:///svn/toku/tokudb.1032b@8338 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
faa303da57
commit
30f7ebcffa
1 changed files with 13 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "../brttypes.h"
|
||||
#include "../bread.h"
|
||||
#include "test.h"
|
||||
|
||||
#define FNAME "test1305.data"
|
||||
|
||||
|
@ -30,8 +31,13 @@ test (u_int64_t fsize) {
|
|||
{
|
||||
int fd = open(FNAME, O_CREAT+O_RDWR+O_BINARY, 0777);
|
||||
assert(fd>=0);
|
||||
u_int64_t buf[N_BIGINTS];
|
||||
static u_int64_t buf[N_BIGINTS]; //windows cannot handle this on the stack
|
||||
while (i*BIGINT_SIZE < fsize) {
|
||||
if (verbose>0 && i % (1<<25) == 0) {
|
||||
printf(" %s:test (%"PRIu64") forwards [%"PRIu64"%%]\n", __FILE__, fsize, 100*BIGINT_SIZE*((u_int64_t)i) / fsize);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
int j;
|
||||
for (j=0; j<N_BIGINTS; j++) {
|
||||
buf[j] = i++;
|
||||
|
@ -47,6 +53,10 @@ test (u_int64_t fsize) {
|
|||
int fd = open(FNAME, O_RDONLY+O_BINARY); assert(fd>=0);
|
||||
BREAD br = create_bread_from_fd_initialize_at(fd, fsize, READBACK_BUFSIZE);
|
||||
while (bread_has_more(br)) {
|
||||
if (verbose>0 && (fsize/BIGINT_SIZE - i) % (1<<25) == 0) {
|
||||
printf(" %s:test (%"PRIu64") backwards [%"PRIu64"%%]\n", __FILE__, fsize, 100*BIGINT_SIZE*((u_int64_t)i) / fsize);
|
||||
fflush(stdout);
|
||||
}
|
||||
assert(i>0);
|
||||
i--;
|
||||
u_int64_t storedi;
|
||||
|
@ -62,7 +72,8 @@ test (u_int64_t fsize) {
|
|||
unlink(FNAME);
|
||||
}
|
||||
|
||||
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
|
||||
int main (int argc, const char *argv[]) {
|
||||
default_parse_args(argc, argv);
|
||||
test(1LL<<23);
|
||||
test(1LL<<30);
|
||||
test(1LL<<31);
|
||||
|
|
Loading…
Add table
Reference in a new issue