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
1819a36a
Commit
1819a36a
authored
Nov 30, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb2: consolidate testing failtest suppression routines.
Less cut & paste means less patching as failtest changes.
parent
407057ed
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
72 deletions
+14
-72
ccan/tdb2/test/failtest_helper.c
ccan/tdb2/test/failtest_helper.c
+5
-0
ccan/tdb2/test/failtest_helper.h
ccan/tdb2/test/failtest_helper.h
+3
-0
ccan/tdb2/test/run-01-new_database.c
ccan/tdb2/test/run-01-new_database.c
+1
-12
ccan/tdb2/test/run-02-expand.c
ccan/tdb2/test/run-02-expand.c
+1
-12
ccan/tdb2/test/run-05-readonly-open.c
ccan/tdb2/test/run-05-readonly-open.c
+1
-12
ccan/tdb2/test/run-10-simple-store.c
ccan/tdb2/test/run-10-simple-store.c
+1
-12
ccan/tdb2/test/run-11-simple-fetch.c
ccan/tdb2/test/run-11-simple-fetch.c
+1
-12
ccan/tdb2/test/run-12-check.c
ccan/tdb2/test/run-12-check.c
+1
-12
No files found.
ccan/tdb2/test/failtest_helper.c
View file @
1819a36a
...
...
@@ -3,6 +3,8 @@
#include <string.h>
#include <ccan/tap/tap.h>
bool
failtest_suppress
=
false
;
/* FIXME: From ccan/str */
static
inline
bool
strends
(
const
char
*
str
,
const
char
*
postfix
)
{
...
...
@@ -84,6 +86,9 @@ block_repeat_failures(struct failtest_call *history, unsigned num)
{
const
struct
failtest_call
*
i
,
*
last
=
&
history
[
num
-
1
];
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
if
(
failmatch
(
last
,
INITIAL_TDB_MALLOC
)
||
failmatch
(
last
,
URANDOM_OPEN
)
||
failmatch
(
last
,
URANDOM_READ
))
{
...
...
ccan/tdb2/test/failtest_helper.h
View file @
1819a36a
...
...
@@ -14,4 +14,7 @@ bool failmatch(const struct failtest_call *call,
enum
failtest_result
block_repeat_failures
(
struct
failtest_call
*
history
,
unsigned
num
);
/* Set this to suppress failure. */
extern
bool
failtest_suppress
;
#endif
/* TDB2_TEST_LOGGING_H */
ccan/tdb2/test/run-01-new_database.c
View file @
1819a36a
...
...
@@ -5,17 +5,6 @@
#include "logging.h"
#include "failtest_helper.h"
static
bool
failtest_suppress
=
false
;
/* Don't need to test everything here, just want expand testing. */
static
enum
failtest_result
suppress_failure
(
struct
failtest_call
*
history
,
unsigned
num
)
{
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
return
block_repeat_failures
(
history
,
num
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
...
...
@@ -30,7 +19,7 @@ int main(int argc, char *argv[])
TDB_NOMMAP
|
TDB_CONVERT
|
TDB_VERSION1
};
failtest_init
(
argc
,
argv
);
failtest_hook
=
suppress_failure
;
failtest_hook
=
block_repeat_failures
;
failtest_exit_check
=
exit_check_log
;
plan_tests
(
sizeof
(
flags
)
/
sizeof
(
flags
[
0
])
*
3
);
for
(
i
=
0
;
i
<
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]);
i
++
)
{
...
...
ccan/tdb2/test/run-02-expand.c
View file @
1819a36a
...
...
@@ -5,17 +5,6 @@
#include "logging.h"
#include "failtest_helper.h"
static
bool
failtest_suppress
=
false
;
/* Don't need to test everything here, just want expand testing. */
static
enum
failtest_result
suppress_failure
(
struct
failtest_call
*
history
,
unsigned
num
)
{
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
return
block_repeat_failures
(
history
,
num
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
...
...
@@ -28,7 +17,7 @@ int main(int argc, char *argv[])
plan_tests
(
sizeof
(
flags
)
/
sizeof
(
flags
[
0
])
*
11
+
1
);
failtest_init
(
argc
,
argv
);
failtest_hook
=
suppress_failure
;
failtest_hook
=
block_repeat_failures
;
failtest_exit_check
=
exit_check_log
;
for
(
i
=
0
;
i
<
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]);
i
++
)
{
...
...
ccan/tdb2/test/run-05-readonly-open.c
View file @
1819a36a
...
...
@@ -5,17 +5,6 @@
#include "logging.h"
#include "failtest_helper.h"
static
bool
failtest_suppress
=
false
;
/* Don't need to test everything here, just want expand testing. */
static
enum
failtest_result
suppress_failure
(
struct
failtest_call
*
history
,
unsigned
num
)
{
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
return
block_repeat_failures
(
history
,
num
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
...
...
@@ -31,7 +20,7 @@ int main(int argc, char *argv[])
unsigned
int
msgs
=
0
;
failtest_init
(
argc
,
argv
);
failtest_hook
=
suppress_failure
;
failtest_hook
=
block_repeat_failures
;
failtest_exit_check
=
exit_check_log
;
seed_attr
.
base
.
attr
=
TDB_ATTRIBUTE_SEED
;
...
...
ccan/tdb2/test/run-10-simple-store.c
View file @
1819a36a
...
...
@@ -5,17 +5,6 @@
#include "logging.h"
#include "failtest_helper.h"
static
bool
failtest_suppress
=
false
;
/* Don't need to test everything here, just want expand testing. */
static
enum
failtest_result
suppress_failure
(
struct
failtest_call
*
history
,
unsigned
num
)
{
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
return
block_repeat_failures
(
history
,
num
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
...
...
@@ -32,7 +21,7 @@ int main(int argc, char *argv[])
struct
tdb_data
data
=
tdb_mkdata
(
"data"
,
4
);
failtest_init
(
argc
,
argv
);
failtest_hook
=
suppress_failure
;
failtest_hook
=
block_repeat_failures
;
failtest_exit_check
=
exit_check_log
;
failtest_suppress
=
true
;
...
...
ccan/tdb2/test/run-11-simple-fetch.c
View file @
1819a36a
...
...
@@ -5,17 +5,6 @@
#include "logging.h"
#include "failtest_helper.h"
static
bool
failtest_suppress
=
false
;
/* Don't need to test everything here, just want fetch testing. */
static
enum
failtest_result
suppress_failure
(
struct
failtest_call
*
history
,
unsigned
num
)
{
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
return
block_repeat_failures
(
history
,
num
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
...
...
@@ -32,7 +21,7 @@ int main(int argc, char *argv[])
struct
tdb_data
data
=
tdb_mkdata
(
"data"
,
4
);
failtest_init
(
argc
,
argv
);
failtest_hook
=
suppress_failure
;
failtest_hook
=
block_repeat_failures
;
failtest_exit_check
=
exit_check_log
;
failtest_suppress
=
true
;
...
...
ccan/tdb2/test/run-12-check.c
View file @
1819a36a
...
...
@@ -6,17 +6,6 @@
#include "logging.h"
#include "failtest_helper.h"
static
bool
failtest_suppress
=
false
;
/* Don't need to test everything here, just want expand testing. */
static
enum
failtest_result
suppress_failure
(
struct
failtest_call
*
history
,
unsigned
num
)
{
if
(
failtest_suppress
)
return
FAIL_DONT_FAIL
;
return
block_repeat_failures
(
history
,
num
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
int
i
;
...
...
@@ -32,7 +21,7 @@ int main(int argc, char *argv[])
struct
tdb_data
data
=
tdb_mkdata
(
"data"
,
4
);
failtest_init
(
argc
,
argv
);
failtest_hook
=
suppress_failure
;
failtest_hook
=
block_repeat_failures
;
failtest_exit_check
=
exit_check_log
;
failtest_suppress
=
true
;
...
...
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