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
e7b5861d
Commit
e7b5861d
authored
Mar 03, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs #46 Fixup dmt-test2 so that it is passing
parent
4bdb0dee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
ft/tests/dmt-test2.cc
ft/tests/dmt-test2.cc
+22
-22
No files found.
ft/tests/dmt-test2.cc
View file @
e7b5861d
...
...
@@ -216,7 +216,7 @@ static void test_builder_fixed(uint32_t len, uint32_t num) {
vdmt
v
;
builder
.
build
(
&
v
);
invariant
(
v
.
value_length_is_fixed
());
invariant
(
v
.
get_fixed_length
()
==
len
);
invariant
(
v
.
get_fixed_length
()
==
len
||
num
==
0
);
invariant
(
v
.
size
()
==
num
);
...
...
@@ -283,12 +283,10 @@ static void test_builder_variable(uint32_t len, uint32_t len2, uint32_t num) {
v
.
destroy
();
}
static
void
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
uint32_t
len
,
uint32_t
num
)
{
static
void
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
uint32_t
len
,
uint32_t
num
)
{
srandom
(
random_seed
);
assert
(
len
>
1
);
assert
(
len
<=
MAXLEN
);
assert
(
num
<=
MAXNUM
);
assert
(
num
>
4
);
for
(
uint32_t
i
=
0
;
i
<
num
;
i
++
)
{
for
(
uint32_t
j
=
0
;
j
<
len
-
1
;
j
++
)
{
data
[
i
][
j
]
=
random
()
%
255
+
1
;
//This way it doesn't end up being 0 and thought of as NUL
...
...
@@ -326,18 +324,20 @@ static void test_create_from_sorted_memory_of_fixed_sized_elements__and__seriali
v
.
serialize_values
(
len
*
num
,
&
wb
);
invariant
(
!
memcmp
(
serialized_flat
,
flat
,
len
*
num
));
//Currently converting to dtree treats the entire thing as NOT fixed length.
//Optional additional perf here.
uint32_t
which
=
(
random
()
%
(
num
-
1
))
+
1
;
// Not last, not first
invariant
(
which
>
0
&&
which
<
num
-
1
);
v
.
delete_at
(
which
);
memmove
(
flat
+
which
*
len
,
flat
+
(
which
+
1
)
*
len
,
(
num
-
which
-
1
)
*
len
);
v
.
prepare_for_serialize
();
wbuf_nocrc_init
(
&
wb
,
serialized_flat
,
len
*
(
num
-
1
));
v
.
serialize_values
(
len
*
(
num
-
1
),
&
wb
);
invariant
(
!
memcmp
(
serialized_flat
,
flat
,
len
*
(
num
-
1
)));
if
(
num
>
1
)
{
//Currently converting to dtree treats the entire thing as NOT fixed length.
//Optional additional perf here.
uint32_t
which
=
(
random
()
%
(
num
-
1
))
+
1
;
// Not last, not first
invariant
(
which
>
0
&&
which
<
num
-
1
);
v
.
delete_at
(
which
);
memmove
(
flat
+
which
*
len
,
flat
+
(
which
+
1
)
*
len
,
(
num
-
which
-
1
)
*
len
);
v
.
prepare_for_serialize
();
wbuf_nocrc_init
(
&
wb
,
serialized_flat
,
len
*
(
num
-
1
));
v
.
serialize_values
(
len
*
(
num
-
1
),
&
wb
);
invariant
(
!
memcmp
(
serialized_flat
,
flat
,
len
*
(
num
-
1
)));
}
toku_free
(
flat
);
toku_free
(
serialized_flat
);
...
...
@@ -361,12 +361,12 @@ test_main(int argc, const char *argv[]) {
test_builder_variable
(
5
,
8
,
100
);
test_builder_variable
(
5
,
10
,
100
);
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
4
,
0
);
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
5
,
0
);
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
4
,
1
);
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
5
,
1
);
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
4
,
100
);
test_create_from_sorted_memory_of_fixed_sized_elements_
_and_
_serialize
(
5
,
100
);
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
4
,
0
);
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
5
,
0
);
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
4
,
1
);
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
5
,
1
);
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
4
,
100
);
test_create_from_sorted_memory_of_fixed_sized_elements_
and
_serialize
(
5
,
100
);
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