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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3bc76c74
Commit
3bc76c74
authored
Jan 21, 2014
by
Yoni Fogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs Tokutek/mongo#886 Clean up test (don't repeat test 3 times), run several more cases
parent
3b200ebe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
src/tests/get_last_key.cc
src/tests/get_last_key.cc
+4
-9
No files found.
src/tests/get_last_key.cc
View file @
3bc76c74
...
@@ -175,7 +175,7 @@ static void cleanup_env_and_db(DB_ENV * env, DB * db)
...
@@ -175,7 +175,7 @@ static void cleanup_env_and_db(DB_ENV * env, DB * db)
static
int
get_last_key_cb
(
const
DBT
*
key
,
const
DBT
*
value
,
void
*
extra
)
{
static
int
get_last_key_cb
(
const
DBT
*
key
,
const
DBT
*
value
,
void
*
extra
)
{
if
(
key
->
data
)
{
if
(
key
->
data
)
{
invariant
(
value
==
NULL
);
invariant
_null
(
value
);
int
expected_key
=
*
(
int
*
)
extra
;
int
expected_key
=
*
(
int
*
)
extra
;
int
found_key
=
*
(
int
*
)
key
->
data
;
int
found_key
=
*
(
int
*
)
key
->
data
;
invariant
(
expected_key
==
(
int
)
ntohl
(
found_key
));
invariant
(
expected_key
==
(
int
)
ntohl
(
found_key
));
...
@@ -183,15 +183,10 @@ static int get_last_key_cb(const DBT *key, const DBT *value, void *extra) {
...
@@ -183,15 +183,10 @@ static int get_last_key_cb(const DBT *key, const DBT *value, void *extra) {
return
0
;
return
0
;
}
}
static
void
check_dbt_matches
(
DB
*
db
,
int
expect_r
,
int
key
)
{
int
r
=
db
->
get_last_key
(
db
,
get_last_key_cb
,
&
key
);
CKERR2
(
r
,
expect_r
);
}
static
void
check_last_key_matches
(
DB
*
db
,
int
expect_r
,
int
key
)
{
static
void
check_last_key_matches
(
DB
*
db
,
int
expect_r
,
int
key
)
{
check_dbt_matches
(
db
,
expect_r
,
key
);
int
r
=
db
->
get_last_key
(
db
,
get_last_key_cb
,
&
key
);
check_dbt_matches
(
db
,
expect_r
,
key
);
CKERR2
(
r
,
expect_r
);
check_dbt_matches
(
db
,
expect_r
,
key
);
}
}
static
void
do_test
(
size_t
ct_size
,
int
num_keys
)
static
void
do_test
(
size_t
ct_size
,
int
num_keys
)
...
@@ -288,7 +283,7 @@ int test_main(int argc, char * const argv[])
...
@@ -288,7 +283,7 @@ int test_main(int argc, char * const argv[])
for
(
int
i
=
0
;
i
<=
2
;
i
++
)
{
for
(
int
i
=
0
;
i
<=
2
;
i
++
)
{
do_test
(
1024
*
1024
,
i
);
do_test
(
1024
*
1024
,
i
);
}
}
for
(
int
i
=
4
;
i
<=
1024
;
i
*=
i
)
{
for
(
int
i
=
4
;
i
<=
1024
;
i
*=
2
)
{
do_test
(
1024
*
1024
,
i
);
do_test
(
1024
*
1024
,
i
);
}
}
...
...
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