mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
d6e96be1f0
git-svn-id: file:///svn/toku/tokudb@13431 c7de825b-a66e-492c-adef-691d508d4ae1
44 lines
1.9 KiB
C
44 lines
1.9 KiB
C
#include <toku_portability.h>
|
|
#include <string.h>
|
|
|
|
#include "test.h"
|
|
#include "brttypes.h"
|
|
#include "includes.h"
|
|
|
|
int test_main(int argc __attribute__((unused)), const char *argv[] __attribute__((unused))) {
|
|
int r=0;
|
|
char dbdir[100] = "/home/wells/svn/tokudb.1857/src/tests/dir.x1.c.tdb";
|
|
struct toku_logcursor *cursor;
|
|
struct log_entry entry;
|
|
|
|
r = toku_logcursor_create(&cursor, dbdir);
|
|
if ( r!=0 ) return r;
|
|
r = toku_logcursor_next(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_next(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_next(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
printf("r=%d\n", r);
|
|
r = toku_logcursor_destroy(&cursor);
|
|
|
|
r = toku_logcursor_create(&cursor, dbdir);
|
|
if ( r!=0 ) return r;
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
printf("r=%d\n", r);
|
|
r = toku_logcursor_destroy(&cursor);
|
|
|
|
r = toku_logcursor_create(&cursor, dbdir);
|
|
if ( r!=0 ) return r;
|
|
r = toku_logcursor_next(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_next(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_next(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
r = toku_logcursor_prev(cursor, &entry); printf("Entry = %c\n", entry.cmd);
|
|
if ( r == DB_NOTFOUND ) printf("PASS\n"); else printf("FAIL\n");
|
|
|
|
r = toku_logcursor_destroy(&cursor);
|
|
|
|
return 0;
|
|
}
|