Commit 3b0e794a authored by unknown's avatar unknown

unittest fixed


storage/maria/unittest/Makefile.am:
  Unittest cleunup added
storage/maria/unittest/ma_control_file-t.c:
  Unittest fixed according new file format
storage/maria/unittest/ma_test_loghandler-t.c:
  Unittest cleunup added
  Unittest progress report added
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  Unittest cleunup added
  Unittest progress report added
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  Unittest cleunup added
  Unittest progress report added
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  Unittest cleunup added
  Unittest progress report added
storage/maria/unittest/ma_maria_log_cleanup.c:
  New BitKeeper file ``storage/maria/unittest/ma_maria_log_cleanup.c''
parent 3bc8f629
......@@ -44,6 +44,11 @@ noinst_PROGRAMS = ma_control_file-t trnman-t lockman2-t \
ma_test_loghandler_multithread-t \
ma_test_loghandler_pagecache-t
ma_test_loghandler_t_SOURCES= ma_test_loghandler-t.c ma_maria_log_cleanup.c
ma_test_loghandler_multigroup_t_SOURCES= ma_test_loghandler_multigroup-t.c ma_maria_log_cleanup.c
ma_test_loghandler_multithread_t_SOURCES= ma_test_loghandler_multithread-t.c ma_maria_log_cleanup.c
ma_test_loghandler_pagecache_t_SOURCES= ma_test_loghandler_pagecache-t.c ma_maria_log_cleanup.c
mf_pagecache_single_src = mf_pagecache_single.c $(top_srcdir)/mysys/mf_pagecache.c test_file.c
mf_pagecache_consist_src = mf_pagecache_consist.c $(top_srcdir)/mysys/mf_pagecache.c test_file.c
mf_pagecache_common_cppflags = -DEXTRA_DEBUG -DPAGECACHE_DEBUG -DMAIN
......
......@@ -83,6 +83,7 @@ static void get_options(int argc, char *argv[]);
int main(int argc,char *argv[])
{
MY_INIT(argv[0]);
maria_data_root= ".";
plan(9);
......@@ -263,18 +264,18 @@ static int test_binary_content()
future change/breakage.
*/
char buffer[17];
char buffer[20];
RET_ERR_UNLESS((fd= my_open(file_name,
O_BINARY | O_RDWR,
MYF(MY_WME))) >= 0);
RET_ERR_UNLESS(my_read(fd, buffer, 17, MYF(MY_FNABP | MY_WME)) == 0);
RET_ERR_UNLESS(my_read(fd, buffer, 20, MYF(MY_FNABP | MY_WME)) == 0);
RET_ERR_UNLESS(my_close(fd, MYF(MY_WME)) == 0);
RET_ERR_UNLESS(create_or_open_file() == CONTROL_FILE_OK);
i= uint4korr(buffer+5);
i= uint3korr(buffer+9);
RET_ERR_UNLESS(i == LSN_FILE_NO(last_checkpoint_lsn));
i= uint4korr(buffer+9);
i= uint4korr(buffer+12);
RET_ERR_UNLESS(i == LSN_OFFSET(last_checkpoint_lsn));
i= uint4korr(buffer+13);
i= uint4korr(buffer+16);
RET_ERR_UNLESS(i == last_logno);
RET_ERR_UNLESS(close_file() == 0);
return 0;
......@@ -341,9 +342,9 @@ static int test_bad_checksum()
RET_ERR_UNLESS((fd= my_open(file_name,
O_BINARY | O_RDWR,
MYF(MY_WME))) >= 0);
RET_ERR_UNLESS(my_pread(fd, buffer, 1, 4, MYF(MY_FNABP | MY_WME)) == 0);
RET_ERR_UNLESS(my_pread(fd, buffer, 1, 8, MYF(MY_FNABP | MY_WME)) == 0);
buffer[0]+= 3; /* mangle checksum */
RET_ERR_UNLESS(my_pwrite(fd, buffer, 1, 4, MYF(MY_FNABP | MY_WME)) == 0);
RET_ERR_UNLESS(my_pwrite(fd, buffer, 1, 8, MYF(MY_FNABP | MY_WME)) == 0);
/* Check that control file module sees the problem */
RET_ERR_UNLESS(ma_control_file_create_or_open() ==
CONTROL_FILE_BAD_CHECKSUM);
......
#include "../maria_def.h"
#include <my_dir.h>
my_bool maria_log_remove()
{
MY_DIR *dirp;
uint i;
MY_STAT stat_buff;
char file_name[FN_REFLEN];
/* Removes control file */
if (fn_format(file_name, CONTROL_FILE_BASE_NAME,
maria_data_root, "", MYF(MY_WME)) == NullS)
return 1;
if (my_stat(file_name, &stat_buff, MYF(0)) &&
my_delete(file_name, MYF(MY_WME)) != 0)
return 1;
/* Finds and removes transaction log files */
if (!(dirp = my_dir(maria_data_root, MYF(MY_DONT_SORT))))
return 1;
for (i= 0; i < dirp->number_off_files; i++)
{
char *file= dirp->dir_entry[i].name;
if (strncmp(file, "maria_log.", 10) == 0 &&
file[10] >= '0' && file[10] <= '9' &&
file[11] >= '0' && file[11] <= '9' &&
file[12] >= '0' && file[12] <= '9' &&
file[13] >= '0' && file[13] <= '9' &&
file[14] >= '0' && file[14] <= '9' &&
file[15] >= '0' && file[15] <= '9' &&
file[16] >= '0' && file[16] <= '9' &&
file[17] >= '0' && file[17] <= '9' &&
file[18] == '\0')
{
if (fn_format(file_name, file,
maria_data_root, "", MYF(MY_WME)) == NullS ||
my_delete(file_name, MYF(MY_WME)) != 0)
return 1;
}
}
return 0;
}
......@@ -3,6 +3,8 @@
#include <errno.h>
#include <tap.h>
extern my_bool maria_log_remove();
#ifndef DBUG_OFF
static const char *default_dbug_option;
#endif
......@@ -113,6 +115,8 @@ int main(int argc, char *argv[])
bzero(&pagecache, sizeof(pagecache));
maria_data_root= ".";
if (maria_log_remove())
exit(1);
for (i= 0; i < (LONG_BUFFER_SIZE + LSN_STORE_SIZE * 2 + 2); i+= 2)
{
......@@ -152,6 +156,8 @@ int main(int argc, char *argv[])
exit(1);
}
plan(((ITERATIONS - 1) * 4 + 1)*2 + ITERATIONS - 1);
srandom(122334817L);
long_tr_id[5]= 0xff;
......@@ -163,14 +169,14 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Can't write record #%lu\n", (ulong) 0);
translog_destroy();
ok(0, "write LOGREC_LONG_TRANSACTION_ID");
exit(1);
}
ok(1, "write LOGREC_LONG_TRANSACTION_ID");
lsn_base= first_lsn= lsn;
for (i= 1; i < ITERATIONS; i++)
{
if (i % 1000 == 0)
printf("write %d\n", i);
if (i % 2)
{
lsn_store(lsn_buff, lsn_base);
......@@ -181,8 +187,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "1 Can't write reference defore record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_CLR_END");
exit(1);
}
ok(1, "write LOGREC_CLR_END");
lsn_store(lsn_buff, lsn_base);
if ((rec_len= random() / (RAND_MAX / (LONG_BUFFER_SIZE + 1))) < 12)
rec_len= 12;
......@@ -194,8 +202,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "1 Can't write var reference defore record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_UNDO_KEY_INSERT");
exit(1);
}
ok(1, "write LOGREC_UNDO_KEY_INSERT");
}
else
{
......@@ -208,8 +218,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "0 Can't write reference defore record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_UNDO_ROW_DELETE");
exit(1);
}
ok(1, "write LOGREC_UNDO_ROW_DELETE");
lsn_store(lsn_buff, lsn_base);
lsn_store(lsn_buff + LSN_STORE_SIZE, first_lsn);
if ((rec_len= random() / (RAND_MAX / (LONG_BUFFER_SIZE + 1))) < 19)
......@@ -222,8 +234,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "0 Can't write var reference defore record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_UNDO_KEY_DELETE");
exit(1);
}
ok(1, "write LOGREC_UNDO_KEY_DELETE");
}
int4store(long_tr_id, i);
if (translog_write_record(&lsn,
......@@ -232,8 +246,10 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Can't write record #%lu\n", (ulong) i);
translog_destroy();
ok(0, "write LOGREC_LONG_TRANSACTION_ID");
exit(1);
}
ok(1, "write LOGREC_LONG_TRANSACTION_ID");
lsn_base= lsn;
......@@ -245,14 +261,18 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Can't write variable record #%lu\n", (ulong) i);
translog_destroy();
ok(0, "write LOGREC_REDO_INSERT_ROW_HEAD");
exit(1);
}
ok(1, "write LOGREC_REDO_INSERT_ROW_HEAD");
if (translog_flush(lsn))
{
fprintf(stderr, "Can't flush #%lu\n", (ulong) i);
translog_destroy();
ok(0, "flush");
exit(1);
}
ok(1, "flush");
}
translog_destroy();
......@@ -303,6 +323,8 @@ int main(int argc, char *argv[])
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
goto err;
}
ok(1, "read record");
translog_free_record_header(&rec);
lsn= first_lsn;
if (translog_init_scanner(first_lsn, 1, &scanner))
{
......@@ -311,8 +333,6 @@ int main(int argc, char *argv[])
}
for (i= 1;; i++)
{
if (i % 1000 == 0)
printf("read %d\n", i);
len= translog_read_next_record_header(&scanner, &rec);
if (len == 0)
{
......@@ -386,6 +406,9 @@ int main(int argc, char *argv[])
goto err;
}
}
ok(1, "read record");
translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec);
if (len == 0)
{
......@@ -476,6 +499,8 @@ int main(int argc, char *argv[])
goto err;
}
}
ok(1, "read record");
translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec);
if (len == 0)
......@@ -505,8 +530,9 @@ int main(int argc, char *argv[])
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
goto err;
}
lsn= rec.lsn;
ok(1, "read record");
translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec);
if ((rec_len= random() / (RAND_MAX / (LONG_BUFFER_SIZE + 1))) < 9)
......@@ -533,14 +559,20 @@ int main(int argc, char *argv[])
(ulong) LSN_FILE_NO(rec.lsn), (ulong) LSN_OFFSET(rec.lsn));
goto err;
}
ok(1, "read record");
translog_free_record_header(&rec);
}
}
rc= 1;
rc= 0;
err:
if (rc)
ok(0, "read record");
translog_destroy();
end_pagecache(&pagecache, 1);
ma_control_file_end();
return(test(exit_status() || rc));
if (maria_log_remove())
exit(1);
return(test(exit_status()));
}
......@@ -3,6 +3,8 @@
#include <errno.h>
#include <tap.h>
extern my_bool maria_log_remove();
#ifndef DBUG_OFF
static const char *default_dbug_option;
#endif
......@@ -13,8 +15,6 @@ static const char *default_dbug_option;
#define MIN_REC_LENGTH (1024L*1024L + 1024L*512L + 1)
#define SHOW_DIVIDER 2
#define LOG_FILE_SIZE (1024L*1024L*1024L + 1024L*1024L*512)
#define ITERATIONS 2
/*#define ITERATIONS 63 */
......@@ -131,6 +131,8 @@ int main(int argc, char *argv[])
bzero(&pagecache, sizeof(pagecache));
maria_data_root= ".";
if (maria_log_remove())
exit(1);
{
byte buff[4];
......@@ -174,6 +176,8 @@ int main(int argc, char *argv[])
exit(1);
}
plan(((ITERATIONS - 1) * 4 + 1) * 2);
srandom(122334817L);
long_tr_id[5]= 0xff;
......@@ -185,14 +189,14 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Can't write record #%lu\n", (ulong) 0);
translog_destroy();
ok(0, "write LOGREC_LONG_TRANSACTION_ID");
exit(1);
}
ok(1, "write LOGREC_LONG_TRANSACTION_ID");
lsn_base= first_lsn= lsn;
for (i= 1; i < ITERATIONS; i++)
{
if (i % SHOW_DIVIDER == 0)
printf("write %d\n", i);
if (i % 2)
{
lsn_store(lsn_buff, lsn_base);
......@@ -204,8 +208,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "1 Can't write reference before record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_CLR_END");
exit(1);
}
ok(1, "write LOGREC_CLR_END");
lsn_store(lsn_buff, lsn_base);
rec_len= get_len();
if (translog_write_record(&lsn,
......@@ -217,8 +223,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "1 Can't write var reference before record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_UNDO_KEY_INSERT");
exit(1);
}
ok(1, "write LOGREC_UNDO_KEY_INSERT");
}
else
{
......@@ -231,8 +239,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "0 Can't write reference before record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_UNDO_ROW_DELETE");
exit(1);
}
ok(1, "write LOGREC_UNDO_ROW_DELETE");
lsn_store(lsn_buff, lsn_base);
lsn_store(lsn_buff + LSN_STORE_SIZE, first_lsn);
rec_len= get_len();
......@@ -245,8 +255,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "0 Can't write var reference before record #%lu\n",
(ulong) i);
translog_destroy();
ok(0, "write LOGREC_UNDO_KEY_DELETE");
exit(1);
}
ok(1, "write LOGREC_UNDO_KEY_DELETE");
}
int4store(long_tr_id, i);
if (translog_write_record(&lsn,
......@@ -255,8 +267,10 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Can't write record #%lu\n", (ulong) i);
translog_destroy();
ok(0, "write LOGREC_LONG_TRANSACTION_ID");
exit(1);
}
ok(1, "write LOGREC_LONG_TRANSACTION_ID");
lsn_base= lsn;
......@@ -267,8 +281,10 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "Can't write variable record #%lu\n", (ulong) i);
translog_destroy();
ok(0, "write LOGREC_REDO_INSERT_ROW_HEAD");
exit(1);
}
ok(1, "write LOGREC_REDO_INSERT_ROW_HEAD");
}
translog_destroy();
......@@ -320,6 +336,7 @@ int main(int argc, char *argv[])
translog_free_record_header(&rec);
goto err;
}
ok(1, "read record");
translog_free_record_header(&rec);
lsn= first_lsn;
if (translog_init_scanner(first_lsn, 1, &scanner))
......@@ -329,8 +346,6 @@ int main(int argc, char *argv[])
}
for (i= 1;; i++)
{
if (i % SHOW_DIVIDER == 0)
printf("read %d\n", i);
len= translog_read_next_record_header(&scanner, &rec);
if (len == 0)
{
......@@ -406,6 +421,7 @@ int main(int argc, char *argv[])
goto err;
}
}
ok(1, "read record");
translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec);
......@@ -500,6 +516,7 @@ int main(int argc, char *argv[])
goto err;
}
}
ok(1, "read record");
translog_free_record_header(&rec);
len= translog_read_next_record_header(&scanner, &rec);
......@@ -533,6 +550,7 @@ int main(int argc, char *argv[])
translog_free_record_header(&rec);
goto err;
}
ok(1, "read record");
translog_free_record_header(&rec);
lsn= rec.lsn;
......@@ -563,14 +581,20 @@ int main(int argc, char *argv[])
translog_free_record_header(&rec);
goto err;
}
ok(1, "read record");
translog_free_record_header(&rec);
}
}
rc= 0;
err:
if (rc)
ok(0, "read record");
translog_destroy();
end_pagecache(&pagecache, 1);
ma_control_file_end();
if (maria_log_remove())
exit(1);
return (test(exit_status() || rc));
return (test(exit_status()));
}
......@@ -2,6 +2,7 @@
#include <stdio.h>
#include <errno.h>
#include <tap.h>
extern my_bool maria_log_remove();
#ifndef DBUG_OFF
static const char *default_dbug_option;
......@@ -33,7 +34,7 @@ static byte *long_buffer;
Get pseudo-random length of the field in
limits [MIN_REC_LENGTH..LONG_BUFFER_SIZE]
SYNOPSYS
SYNOPSIS
get_len()
RETURN
......@@ -101,8 +102,7 @@ static my_bool read_and_check_content(TRANSLOG_HEADER_BUFFER *rec,
{
int res= 0;
translog_size_t len;
DBUG_ENTER("read_and_check_content");
DBUG_ASSERT(rec->record_length < LONG_BUFFER_SIZE + 7 * 2 + 2);
if ((len= translog_read_record(rec->lsn, 0, rec->record_length,
buffer, NULL)) != rec->record_length)
{
......@@ -111,7 +111,7 @@ static my_bool read_and_check_content(TRANSLOG_HEADER_BUFFER *rec,
res= 1;
}
res|= check_content(buffer + skip, rec->record_length - skip);
DBUG_RETURN(res);
return(res);
}
void writer(int num)
......@@ -119,7 +119,6 @@ void writer(int num)
LSN lsn;
byte long_tr_id[6];
uint i;
DBUG_ENTER("writer");
for (i= 0; i < ITERATIONS; i++)
{
......@@ -135,6 +134,9 @@ void writer(int num)
fprintf(stderr, "Can't write LOGREC_LONG_TRANSACTION_ID record #%lu "
"thread %i\n", (ulong) i, num);
translog_destroy();
pthread_mutex_lock(&LOCK_thread_count);
ok(0, "write records");
pthread_mutex_unlock(&LOCK_thread_count);
return;
}
lsns1[num][i]= lsn;
......@@ -144,25 +146,17 @@ void writer(int num)
{
fprintf(stderr, "Can't write variable record #%lu\n", (ulong) i);
translog_destroy();
pthread_mutex_lock(&LOCK_thread_count);
ok(0, "write records");
pthread_mutex_unlock(&LOCK_thread_count);
return;
}
lsns2[num][i]= lsn;
DBUG_PRINT("info", ("thread: %u, iteration: %u, len: %lu, "
"lsn1 (%lu,0x%lx) lsn2 (%lu,0x%lx)",
num, i, (ulong) lens[num][i],
(ulong) LSN_FILE_NO(lsns1[num][i]),
(ulong) LSN_OFFSET(lsns1[num][i]),
(ulong) LSN_FILE_NO(lsns2[num][i]),
(ulong) LSN_OFFSET(lsns2[num][i])));
printf("thread: %u, iteration: %u, len: %lu, "
"lsn1 (%lu,0x%lx) lsn2 (%lu,0x%lx)\n",
num, i, (ulong) lens[num][i],
(ulong) LSN_FILE_NO(lsns1[num][i]),
(ulong) LSN_OFFSET(lsns1[num][i]),
(ulong) LSN_FILE_NO(lsns2[num][i]),
(ulong) LSN_OFFSET(lsns2[num][i]));
pthread_mutex_lock(&LOCK_thread_count);
ok(1, "write records");
pthread_mutex_unlock(&LOCK_thread_count);
}
DBUG_VOID_RETURN;
return;
}
......@@ -171,20 +165,18 @@ static void *test_thread_writer(void *arg)
int param= *((int*) arg);
my_thread_init();
DBUG_ENTER("test_writer");
DBUG_PRINT("enter", ("param: %d", param));
writer(param);
DBUG_PRINT("info", ("Thread %s ended\n", my_thread_name()));
pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
ok(1, "writer finished"); /* just to show progress */
VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are
ready */
pthread_mutex_unlock(&LOCK_thread_count);
free((gptr) arg);
my_thread_end();
DBUG_RETURN(0);
return(0);
}
......@@ -201,6 +193,8 @@ int main(int argc, char **argv __attribute__ ((unused)))
int *param, error;
int rc;
plan(WRITERS + ITERATIONS * WRITERS * 3);
bzero(&pagecache, sizeof(pagecache));
maria_data_root= ".";
long_buffer= malloc(LONG_BUFFER_SIZE + 7 * 2 + 2);
......@@ -212,8 +206,10 @@ int main(int argc, char **argv __attribute__ ((unused)))
for (i= 0; i < (LONG_BUFFER_SIZE + 7 * 2 + 2); i++)
long_buffer[i]= (i & 0xFF);
MY_INIT(argv[0]);
if (maria_log_remove())
exit(1);
#ifndef DBUG_OFF
#if defined(__WIN__)
......@@ -228,8 +224,6 @@ int main(int argc, char **argv __attribute__ ((unused)))
}
#endif
DBUG_ENTER("main");
DBUG_PRINT("info", ("Main thread: %s\n", my_thread_name()));
if ((error= pthread_cond_init(&COND_thread_count, NULL)))
{
......@@ -327,7 +321,6 @@ int main(int argc, char **argv __attribute__ ((unused)))
thread_count++;
number_of_writers--;
}
DBUG_PRINT("info", ("All threads are started"));
pthread_mutex_unlock(&LOCK_thread_count);
pthread_attr_destroy(&thr_attr);
......@@ -342,7 +335,6 @@ int main(int argc, char **argv __attribute__ ((unused)))
}
if ((error= pthread_mutex_unlock(&LOCK_thread_count)))
fprintf(stderr, "LOCK_thread_count: %d from pthread_mutex_unlock\n", error);
DBUG_PRINT("info", ("All threads ended"));
/* Find last LSN and flush up to it (all our log) */
{
......@@ -352,11 +344,6 @@ int main(int argc, char **argv __attribute__ ((unused)))
if (cmp_translog_addr(lsns2[i][ITERATIONS - 1], max) > 0)
max= lsns2[i][ITERATIONS - 1];
}
DBUG_PRINT("info", ("first lsn: (%lu,0x%lx), max lsn: (%lu,0x%lx)",
(ulong) LSN_FILE_NO(first_lsn),
(ulong) LSN_OFFSET(first_lsn),
(ulong) LSN_FILE_NO(max),
(ulong) LSN_OFFSET(max)));
translog_flush(max);
}
......@@ -398,8 +385,6 @@ int main(int argc, char **argv __attribute__ ((unused)))
}
index= indeces[rec.short_trid] / 2;
stage= indeces[rec.short_trid] % 2;
printf("read(%d) thread: %d, iteration %d, stage %d\n",
i, (uint) rec.short_trid, index, stage);
if (stage == 0)
{
if (rec.type !=LOGREC_LONG_TRANSACTION_ID ||
......@@ -459,6 +444,7 @@ int main(int argc, char **argv __attribute__ ((unused)))
goto err;
}
}
ok(1, "record read");
translog_free_record_header(&rec);
indeces[rec.short_trid]++;
}
......@@ -466,9 +452,13 @@ int main(int argc, char **argv __attribute__ ((unused)))
rc= 0;
err:
if (rc)
ok(0, "record read");
translog_destroy();
end_pagecache(&pagecache, 1);
ma_control_file_end();
if (maria_log_remove())
exit(1);
DBUG_RETURN(test(exit_status() || rc));
return(exit_status());
}
......@@ -3,6 +3,8 @@
#include <errno.h>
#include <tap.h>
extern my_bool maria_log_remove();
#ifndef DBUG_OFF
static const char *default_dbug_option;
#endif
......@@ -26,8 +28,12 @@ int main(int argc, char *argv[])
MY_INIT(argv[0]);
plan(1);
bzero(&pagecache, sizeof(pagecache));
maria_data_root= ".";
if (maria_log_remove())
exit(1);
/* be sure that we have no logs in the directory*/
if (my_stat(CONTROL_FILE_BASE_NAME, &st, MYF(0)))
my_delete(CONTROL_FILE_BASE_NAME, MYF(0));
......@@ -127,8 +133,10 @@ int main(int argc, char *argv[])
"incorrect initial size of %s: %ld instead of %ld\n",
first_translog_file,
(long)st.st_size, (long)(TRANSLOG_PAGE_SIZE * 2));
ok(0, "log triggered");
exit(1);
}
ok(1, "log triggered");
translog_destroy();
end_pagecache(&pagecache, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment