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
72c55b03
Commit
72c55b03
authored
Jul 07, 2009
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
const addition changes from brian, awfulhak.org
parent
1c1a74f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
26 deletions
+27
-26
ccan/tap/tap.3
ccan/tap/tap.3
+12
-11
ccan/tap/tap.c
ccan/tap/tap.c
+9
-9
ccan/tap/tap.h
ccan/tap/tap.h
+6
-6
No files found.
ccan/tap/tap.3
View file @
72c55b03
...
...
@@ -16,9 +16,9 @@ their success or failure.
.Ss PRINTF STRINGS
In the descriptions that follow, for any function that takes as the
last two parameters
.Dq Fa char * , Fa ...
.Dq Fa c
onst c
har * , Fa ...
it can be assumed that the
.Fa char *
.Fa c
onst c
har *
is a
.Fn printf
-like format string, and the optional arguments are values to be placed
...
...
@@ -35,7 +35,7 @@ in that string.
.Xc
.It Xo
.Ft void
.Fn plan_skip_all "char *" "..."
.Fn plan_skip_all "c
onst c
har *" "..."
.Xc
.El
.Pp
...
...
@@ -74,7 +74,7 @@ the tests.
.Bl -tag -width indent
.It Xo
.Ft unsigned int
.Fn ok "expression" "char *" "..."
.Fn ok "expression" "c
onst c
har *" "..."
.Xc
.It Xo
.Ft unsigned int
...
...
@@ -82,11 +82,11 @@ the tests.
.Xc
.It Xo
.Ft unsigned int
.Fn pass "char *" "..."
.Fn pass "c
onst c
har *" "..."
.Xc
.It Xo
.Ft unsigned int
.Fn fail "char *" "..."
.Fn fail "c
onst c
har *" "..."
.Xc
.El
.Pp
...
...
@@ -161,10 +161,10 @@ These are synonyms for ok(1, ...) and ok(0, ...).
.Bl -tag -width indent
.It Xo
.Ft void
.Fn skip "unsigned int" "char *" "..."
.Fn skip "unsigned int" "c
onst c
har *" "..."
.Xc
.It Xo
.Fn skip_if "expression" "unsigned int" "char *" "..."
.Fn skip_if "expression" "unsigned int" "c
onst c
har *" "..."
.Xc
.El
.Pp
...
...
@@ -204,7 +204,7 @@ skip_if(getuid() != 0, 1, "because test only works as root") {
.Bl -tag -width indent
.It Xo
.Ft void
.Fn todo_start "char *" "..."
.Fn todo_start "c
onst c
har *" "..."
.Xc
.It Xo
.Ft void
...
...
@@ -261,8 +261,8 @@ yet to fix, but want to put tests in your testing script
.Ss DIAGNOSTIC OUTPUT
.Bl -tag -width indent
.It Xo
.Fr
void
.Fn diag "char *" "..."
.Fr
int
.Fn diag "c
onst c
har *" "..."
.Xc
.El
.Pp
...
...
@@ -273,6 +273,7 @@ It ensures that the output will not be considered by the TAP test harness.
adds the necessary trailing
.Dq \en
for you.
It returns the number of characters written.
.Bd -literal -offset indent
diag("Expected return code 0, got return code %d", rcode);
.Ed
...
...
ccan/tap/tap.c
View file @
72c55b03
...
...
@@ -42,7 +42,7 @@ static unsigned int test_count = 0; /* Number of tests that have been run */
static
unsigned
int
e_tests
=
0
;
/* Expected number of tests to run */
static
unsigned
int
failures
=
0
;
/* Number of tests that failed */
static
char
*
todo_msg
=
NULL
;
static
char
*
todo_msg_fixed
=
"libtap malloc issue"
;
static
c
onst
c
har
*
todo_msg_fixed
=
"libtap malloc issue"
;
static
int
todo
=
0
;
static
int
test_died
=
0
;
static
int
test_pid
;
...
...
@@ -68,7 +68,7 @@ _expected_tests(unsigned int tests)
}
static
void
diagv
(
char
*
fmt
,
va_list
ap
)
diagv
(
c
onst
c
har
*
fmt
,
va_list
ap
)
{
fputs
(
"# "
,
stdout
);
vfprintf
(
stdout
,
fmt
,
ap
);
...
...
@@ -76,7 +76,7 @@ diagv(char *fmt, va_list ap)
}
static
void
_diag
(
char
*
fmt
,
...)
_diag
(
c
onst
c
har
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
...
...
@@ -92,8 +92,8 @@ _diag(char *fmt, ...)
* test_comment -- a comment to print afterwards, may be NULL
*/
unsigned
int
_gen_result
(
int
ok
,
const
char
*
func
,
char
*
file
,
unsigned
int
line
,
char
*
test_name
,
...)
_gen_result
(
int
ok
,
const
char
*
func
,
c
onst
c
har
*
file
,
unsigned
int
line
,
c
onst
c
har
*
test_name
,
...)
{
va_list
ap
;
char
*
local_test_name
=
NULL
;
...
...
@@ -293,7 +293,7 @@ plan_no_plan(void)
* Note that the plan is to skip all tests
*/
void
plan_skip_all
(
char
*
reason
)
plan_skip_all
(
c
onst
c
har
*
reason
)
{
LOCK
;
...
...
@@ -345,7 +345,7 @@ plan_tests(unsigned int tests)
}
void
diag
(
char
*
fmt
,
...)
diag
(
c
onst
c
har
*
fmt
,
...)
{
va_list
ap
;
...
...
@@ -359,7 +359,7 @@ diag(char *fmt, ...)
}
void
skip
(
unsigned
int
n
,
char
*
fmt
,
...)
skip
(
unsigned
int
n
,
c
onst
c
har
*
fmt
,
...)
{
va_list
ap
;
char
*
skip_msg
;
...
...
@@ -384,7 +384,7 @@ skip(unsigned int n, char *fmt, ...)
}
void
todo_start
(
char
*
fmt
,
...)
todo_start
(
c
onst
c
har
*
fmt
,
...)
{
va_list
ap
;
...
...
ccan/tap/tap.h
View file @
72c55b03
...
...
@@ -124,8 +124,8 @@ void plan_tests(unsigned int tests);
#endif
#endif
unsigned
int
_gen_result
(
int
,
const
char
*
,
c
har
*
,
unsigned
int
,
char
*
,
...)
PRINTF_ATTRIBUTE
(
5
,
6
);
unsigned
int
_gen_result
(
int
,
const
char
*
,
c
onst
char
*
,
unsigned
int
,
const
char
*
,
...)
PRINTF_ATTRIBUTE
(
5
,
6
);
/**
* diag - print a diagnostic message (use instead of printf/fprintf)
...
...
@@ -137,7 +137,7 @@ unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...)
* Example:
* diag("Now running complex tests");
*/
void
diag
(
char
*
fmt
,
...)
PRINTF_ATTRIBUTE
(
1
,
2
);
void
diag
(
c
onst
c
har
*
fmt
,
...)
PRINTF_ATTRIBUTE
(
1
,
2
);
/**
* skip - print a diagnostic message (use instead of printf/fprintf)
...
...
@@ -160,7 +160,7 @@ void diag(char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
* skip(1, "Don't have SOME_FEATURE");
* #endif
*/
void
skip
(
unsigned
int
n
,
char
*
fmt
,
...)
PRINTF_ATTRIBUTE
(
2
,
3
);
void
skip
(
unsigned
int
n
,
c
onst
c
har
*
fmt
,
...)
PRINTF_ATTRIBUTE
(
2
,
3
);
/**
* todo_start - mark tests that you expect to fail.
...
...
@@ -185,7 +185,7 @@ void skip(unsigned int n, char *fmt, ...) PRINTF_ATTRIBUTE(2, 3);
* ok(dwim(), "Did what the user wanted");
* todo_end();
*/
void
todo_start
(
char
*
fmt
,
...)
PRINTF_ATTRIBUTE
(
1
,
2
);
void
todo_start
(
c
onst
c
har
*
fmt
,
...)
PRINTF_ATTRIBUTE
(
1
,
2
);
/**
* todo_end - end of tests you expect to fail.
...
...
@@ -241,6 +241,6 @@ void plan_no_plan(void);
* }
* plan_tests(13);
*/
void
plan_skip_all
(
char
*
reason
);
void
plan_skip_all
(
c
onst
c
har
*
reason
);
#endif
/* C99 or gcc */
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