Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
d71f8b0b
Commit
d71f8b0b
authored
Oct 25, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb2: fix intermittent test fail.
With correct seed, we could expand hash and break test.
parent
7e381e6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
ccan/tdb2/test/run-30-exhaust-before-expand.c
ccan/tdb2/test/run-30-exhaust-before-expand.c
+2
-14
No files found.
ccan/tdb2/test/run-30-exhaust-before-expand.c
View file @
d71f8b0b
...
...
@@ -8,12 +8,6 @@
#include <err.h>
#include "logging.h"
static
uint64_t
fixedhash
(
const
void
*
key
,
size_t
len
,
uint64_t
seed
,
void
*
p
)
{
return
hash64_stable
((
const
unsigned
char
*
)
key
,
len
,
*
(
uint64_t
*
)
p
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
,
j
;
...
...
@@ -21,13 +15,7 @@ int main(int argc, char *argv[])
int
flags
[]
=
{
TDB_INTERNAL
,
TDB_DEFAULT
,
TDB_NOMMAP
,
TDB_INTERNAL
|
TDB_CONVERT
,
TDB_CONVERT
,
TDB_NOMMAP
|
TDB_CONVERT
};
uint64_t
seed
=
0
;
union
tdb_attribute
fixed_hattr
=
{
.
hash
=
{
.
base
=
{
TDB_ATTRIBUTE_HASH
},
.
hash_fn
=
fixedhash
,
.
hash_private
=
&
seed
}
};
fixed_hattr
.
base
.
next
=
&
tap_log_attr
;
plan_tests
(
sizeof
(
flags
)
/
sizeof
(
flags
[
0
])
*
5
+
1
);
for
(
i
=
0
;
i
<
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]);
i
++
)
{
...
...
@@ -45,9 +33,9 @@ int main(int argc, char *argv[])
continue
;
/* We don't want the hash to expand, so we use one alloc to
* chew up over
90%
of the space first. */
* chew up over
most
of the space first. */
j
=
-
1
;
d
.
dsize
=
(
1
<<
INITIAL_ZONE_BITS
)
*
9
/
1
0
;
d
.
dsize
=
(
1
<<
INITIAL_ZONE_BITS
)
-
50
0
;
d
.
dptr
=
malloc
(
d
.
dsize
);
ok1
(
tdb_store
(
tdb
,
k
,
d
,
TDB_INSERT
)
==
0
);
ok1
(
tdb
->
map_size
==
sizeof
(
struct
tdb_header
)
...
...
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