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
1c8876ee
Commit
1c8876ee
authored
Jul 30, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests run again
git-svn-id:
file:///svn/tokudb@68
c7de825b-a66e-492c-adef-691d508d4ae1
parent
7896ccf7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
2 deletions
+36
-2
newbrt/brt-test.c
newbrt/brt-test.c
+5
-0
newbrt/brt.c
newbrt/brt.c
+5
-0
newbrt/hashtable.c
newbrt/hashtable.c
+2
-2
newbrt/hashtest.c
newbrt/hashtest.c
+24
-0
No files found.
newbrt/brt-test.c
View file @
1c8876ee
...
...
@@ -854,6 +854,11 @@ static void brt_blackbox_test (void) {
test3
(
1
<<
18
,
1
<<
20
,
0
);
test4
(
1
<<
18
,
1
<<
20
,
0
);
// Once upon a time srandom(8) caused this test to fail.
srandom
(
8
);
test4
(
2048
,
1
<<
15
,
1
);
// test3(1<<19, 1<<20, 0);
// test4(1<<19, 1<<20, 0);
...
...
newbrt/brt.c
View file @
1c8876ee
...
...
@@ -677,6 +677,11 @@ static int push_some_kvpairs_down (BRT t, BRTNODE node, int childnum,
* good way to do it otherwise. I want to loop over the elements of the hash table, deleting some as I
* go. The HASHTABLE_ITERATE macro will break if I delete something from the hash table. */
if
(
0
)
{
static
int
count
=
0
;
count
++
;
printf
(
"%s:%d pushing %d count=%d
\n
"
,
__FILE__
,
__LINE__
,
childnum
,
count
);
}
{
bytevec
key
,
val
;
ITEMLEN
keylen
,
vallen
;
...
...
newbrt/hashtable.c
View file @
1c8876ee
...
...
@@ -15,7 +15,7 @@ int toku_hashtable_create (HASHTABLE *h) {
int
i
;
if
(
tab
==
0
)
return
-
1
;
tab
->
n_keys
=
0
;
tab
->
arraysize
=
12
8
;
tab
->
arraysize
=
8
;
assert
(
sizeof
(
*
tab
->
array
)
==
sizeof
(
void
*
));
tab
->
array
=
toku_calloc
(
tab
->
arraysize
,
sizeof
(
*
tab
->
array
));
for
(
i
=
0
;
i
<
tab
->
arraysize
;
i
++
)
tab
->
array
[
i
]
=
0
;
...
...
@@ -139,7 +139,7 @@ int toku_hashtable_random_pick(HASHTABLE h, bytevec *key, ITEMLEN *keylen, bytev
int
i
;
int
usei
=
random
()
%
h
->
arraysize
;
for
(
i
=
0
;
i
<
h
->
arraysize
;
i
++
,
usei
++
)
{
if
(
usei
>
h
->
arraysize
)
usei
=
0
;
if
(
usei
>
=
h
->
arraysize
)
usei
=
0
;
HASHELT
he
=
h
->
array
[
usei
];
if
(
he
)
{
*
key
=
he
->
key
;
...
...
newbrt/hashtest.c
View file @
1c8876ee
...
...
@@ -107,7 +107,31 @@ void test0 (void) {
}
}
void
test1
(
void
)
{
HASHTABLE
table
;
int
i
,
r
;
r
=
toku_hashtable_create
(
&
table
);
assert
(
r
==
0
);
for
(
i
=
0
;
i
<
100
;
i
++
)
{
char
keys
[
4
][
100
],
vals
[
4
][
100
];
int
j
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
snprintf
(
keys
[
j
],
100
,
"k%ld"
,
random
());
snprintf
(
vals
[
j
],
100
,
"v%d"
,
j
);
toku_hash_insert
(
table
,
keys
[
j
],
strlen
(
keys
[
j
])
+
1
,
vals
[
j
],
strlen
(
vals
[
j
])
+
1
);
}
for
(
j
=
0
;
j
<
4
;
j
++
)
{
bytevec
key
,
val
;
ITEMLEN
keylen
,
vallen
;
r
=
toku_hashtable_random_pick
(
table
,
&
key
,
&
keylen
,
&
val
,
&
vallen
);
assert
(
r
==
0
);
r
=
toku_hash_delete
(
table
,
key
,
keylen
);
assert
(
r
==
0
);
}
}
}
int
main
(
int
argc
__attribute__
((
__unused__
)),
char
*
argv
[]
__attribute__
((
__unused__
)))
{
test0
();
test1
();
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