Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c5911c1f
Commit
c5911c1f
authored
Aug 24, 2007
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove cursor debug tracing
git-svn-id:
file:///svn/tokudb@193
c7de825b-a66e-492c-adef-691d508d4ae1
parent
53d05849
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
25 deletions
+27
-25
newbrt/brt-test.c
newbrt/brt-test.c
+27
-25
No files found.
newbrt/brt-test.c
View file @
c5911c1f
...
...
@@ -809,6 +809,8 @@ static void test_wrongendian_compare (int wrong_p, unsigned int N) {
memory_check_all_free
();
}
int
test_cursor_debug
=
0
;
void
assert_tree_first
(
BRT
brt
,
long
long
firstv
)
{
BRT_CURSOR
cursor
;
int
r
;
...
...
@@ -818,18 +820,18 @@ void assert_tree_first(BRT brt, long long firstv) {
r
=
brt_cursor
(
brt
,
&
cursor
);
assert
(
r
==
0
);
printf
(
"first key: "
);
if
(
test_cursor_debug
)
printf
(
"first key: "
);
init_dbt
(
&
kbt
);
kbt
.
flags
=
DB_DBT_MALLOC
;
init_dbt
(
&
vbt
);
vbt
.
flags
=
DB_DBT_MALLOC
;
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_FIRST
);
assert
(
r
==
0
);
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
assert
(
vbt
.
size
==
sizeof
v
);
memcpy
(
&
v
,
vbt
.
data
,
vbt
.
size
);
assert
(
v
==
firstv
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
r
=
brt_cursor_close
(
cursor
);
assert
(
r
==
0
);
...
...
@@ -844,18 +846,18 @@ void assert_tree_last(BRT brt, long long lastv) {
r
=
brt_cursor
(
brt
,
&
cursor
);
assert
(
r
==
0
);
printf
(
"last key:"
);
if
(
test_cursor_debug
)
printf
(
"last key:"
);
init_dbt
(
&
kbt
);
kbt
.
flags
=
DB_DBT_MALLOC
;
init_dbt
(
&
vbt
);
vbt
.
flags
=
DB_DBT_MALLOC
;
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_LAST
);
assert
(
r
==
0
);
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
assert
(
vbt
.
size
==
sizeof
v
);
memcpy
(
&
v
,
vbt
.
data
,
vbt
.
size
);
assert
(
v
==
lastv
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
r
=
brt_cursor_close
(
cursor
);
assert
(
r
==
0
);
...
...
@@ -870,31 +872,31 @@ void assert_tree_first_last(BRT brt, long long firstv, long long lastv) {
r
=
brt_cursor
(
brt
,
&
cursor
);
assert
(
r
==
0
);
printf
(
"first key: "
);
if
(
test_cursor_debug
)
printf
(
"first key: "
);
init_dbt
(
&
kbt
);
kbt
.
flags
=
DB_DBT_MALLOC
;
init_dbt
(
&
vbt
);
vbt
.
flags
=
DB_DBT_MALLOC
;
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_FIRST
);
assert
(
r
==
0
);
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
assert
(
vbt
.
size
==
sizeof
v
);
memcpy
(
&
v
,
vbt
.
data
,
vbt
.
size
);
assert
(
v
==
firstv
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
printf
(
"last key:"
);
if
(
test_cursor_debug
)
printf
(
"last key:"
);
init_dbt
(
&
kbt
);
kbt
.
flags
=
DB_DBT_MALLOC
;
init_dbt
(
&
vbt
);
vbt
.
flags
=
DB_DBT_MALLOC
;
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_LAST
);
assert
(
r
==
0
);
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
assert
(
vbt
.
size
==
sizeof
v
);
memcpy
(
&
v
,
vbt
.
data
,
vbt
.
size
);
assert
(
v
==
lastv
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
r
=
brt_cursor_close
(
cursor
);
assert
(
r
==
0
);
...
...
@@ -1064,7 +1066,7 @@ void assert_tree_walk(BRT brt, int n) {
r
=
brt_cursor
(
brt
,
&
cursor
);
assert
(
r
==
0
);
printf
(
"key: "
);
if
(
test_cursor_debug
)
printf
(
"key: "
);
for
(
i
=
0
;
;
i
++
)
{
DBT
kbt
,
vbt
;
long
long
v
;
...
...
@@ -1074,14 +1076,14 @@ void assert_tree_walk(BRT brt, int n) {
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_NEXT
);
if
(
r
!=
0
)
break
;
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
assert
(
vbt
.
size
==
sizeof
v
);
memcpy
(
&
v
,
vbt
.
data
,
vbt
.
size
);
assert
(
v
==
i
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
}
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
assert
(
i
==
n
);
r
=
brt_cursor_close
(
cursor
);
...
...
@@ -1138,7 +1140,7 @@ void assert_tree_walk_inorder(BRT brt, int n) {
assert
(
r
==
0
);
prevkey
=
0
;
printf
(
"key: "
);
if
(
test_cursor_debug
)
printf
(
"key: "
);
for
(
i
=
0
;
;
i
++
)
{
DBT
kbt
,
vbt
;
long
long
v
;
...
...
@@ -1148,7 +1150,7 @@ void assert_tree_walk_inorder(BRT brt, int n) {
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_NEXT
);
if
(
r
!=
0
)
break
;
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
assert
(
vbt
.
size
==
sizeof
v
);
memcpy
(
&
v
,
vbt
.
data
,
vbt
.
size
);
if
(
i
!=
0
)
{
...
...
@@ -1159,7 +1161,7 @@ void assert_tree_walk_inorder(BRT brt, int n) {
toku_free
(
vbt
.
data
);
}
if
(
prevkey
)
toku_free
(
prevkey
);
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
assert
(
i
==
n
);
r
=
brt_cursor_close
(
cursor
);
...
...
@@ -1250,17 +1252,17 @@ void test_brt_cursor_split(int n) {
r
=
brt_cursor
(
brt
,
&
cursor
);
assert
(
r
==
0
);
printf
(
"key: "
);
if
(
test_cursor_debug
)
printf
(
"key: "
);
for
(
i
=
0
;
i
<
n
/
2
;
i
++
)
{
init_dbt
(
&
kbt
);
kbt
.
flags
=
DB_DBT_MALLOC
;
init_dbt
(
&
vbt
);
vbt
.
flags
=
DB_DBT_MALLOC
;
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_NEXT
);
assert
(
r
==
0
);
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
}
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
for
(;
keyseqnum
<
n
;
keyseqnum
++
)
{
char
key
[
8
];
long
long
v
;
...
...
@@ -1273,18 +1275,18 @@ void test_brt_cursor_split(int n) {
assert
(
r
==
0
);
}
printf
(
"key: "
);
if
(
test_cursor_debug
)
printf
(
"key: "
);
for
(;;)
{
init_dbt
(
&
kbt
);
kbt
.
flags
=
DB_DBT_MALLOC
;
init_dbt
(
&
vbt
);
vbt
.
flags
=
DB_DBT_MALLOC
;
r
=
brt_c_get
(
cursor
,
&
kbt
,
&
vbt
,
DB_NEXT
);
if
(
r
!=
0
)
break
;
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
if
(
test_cursor_debug
)
printf
(
"%s "
,
(
char
*
)
kbt
.
data
);
toku_free
(
kbt
.
data
);
toku_free
(
vbt
.
data
);
}
printf
(
"
\n
"
);
if
(
test_cursor_debug
)
printf
(
"
\n
"
);
r
=
brt_cursor_close
(
cursor
);
assert
(
r
==
0
);
...
...
@@ -1390,6 +1392,6 @@ static void brt_blackbox_test (void) {
int
main
(
int
argc
__attribute__
((
__unused__
)),
char
*
argv
[]
__attribute__
((
__unused__
)))
{
brt_blackbox_test
();
malloc_cleanup
();
printf
(
"ok
\n
"
);
printf
(
"
test
ok
\n
"
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment