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
e84f843d
Commit
e84f843d
authored
Jun 29, 2009
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zero-append test for tdb.
parent
cd065f97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
ccan/tdb/test/run-zero-append.c
ccan/tdb/test/run-zero-append.c
+37
-0
No files found.
ccan/tdb/test/run-zero-append.c
0 → 100644
View file @
e84f843d
#define _XOPEN_SOURCE 500
#include "tdb/tdb.h"
#include "tdb/io.c"
#include "tdb/tdb.c"
#include "tdb/lock.c"
#include "tdb/freelist.c"
#include "tdb/traverse.c"
#include "tdb/transaction.c"
#include "tdb/error.c"
#include "tdb/open.c"
#include "tap/tap.h"
#include <stdlib.h>
#include <err.h>
int
main
(
int
argc
,
char
*
argv
[])
{
struct
tdb_context
*
tdb
;
TDB_DATA
key
,
data
;
plan_tests
(
4
);
tdb
=
tdb_open
(
NULL
,
1024
,
TDB_INTERNAL
,
O_CREAT
|
O_TRUNC
|
O_RDWR
,
0600
);
ok1
(
tdb
);
/* Tickle bug on appending zero length buffer to zero length buffer. */
key
.
dsize
=
strlen
(
"hi"
);
key
.
dptr
=
(
void
*
)
"hi"
;
data
.
dptr
=
(
void
*
)
"world"
;
data
.
dsize
=
0
;
ok1
(
tdb_append
(
tdb
,
key
,
data
)
==
0
);
ok1
(
tdb_append
(
tdb
,
key
,
data
)
==
0
);
data
=
tdb_fetch
(
tdb
,
key
);
ok1
(
data
.
dsize
==
0
);
tdb_close
(
tdb
);
return
exit_status
();
}
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