Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent
Commits
c16c4334
Commit
c16c4334
authored
Mar 30, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a test for format.c/get_tag()
parent
d0064936
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
test_format.c
src/test/test_format.c
+30
-0
No files found.
src/test/test_format.c
View file @
c16c4334
...
...
@@ -116,11 +116,41 @@ static const char
return
NULL
;
}
static
const
char
*
test_format_get_tag
(
void
)
{
tx_t
tx
;
#define NRECORDS 10
logline_t
recs
[
NRECORDS
],
*
rec
;
printf
(
"... testing get_tag()
\n
"
);
tx
.
magic
=
TX_MAGIC
;
VSTAILQ_INIT
(
&
tx
.
lines
);
for
(
int
i
=
0
;
i
<
NRECORDS
;
i
++
)
{
recs
[
i
].
magic
=
LOGLINE_MAGIC
;
recs
[
i
].
tag
=
SLT_ReqHeader
;
VSTAILQ_INSERT_TAIL
(
&
tx
.
lines
,
&
recs
[
i
],
linelist
);
}
recs
[
NRECORDS
/
2
].
tag
=
SLT_RespHeader
;
recs
[
NRECORDS
-
1
].
tag
=
SLT_RespHeader
;
rec
=
get_tag
(
&
tx
,
SLT_RespHeader
);
MASSERT
(
rec
==
&
recs
[
NRECORDS
-
1
]);
/* Empty line list */
VSTAILQ_INIT
(
&
tx
.
lines
);
rec
=
get_tag
(
&
tx
,
SLT_ReqHeader
);
MAZ
(
rec
);
return
NULL
;
}
static
const
char
*
all_tests
(
void
)
{
mu_run_test
(
test_format_init
);
mu_run_test
(
test_format_get_payload
);
mu_run_test
(
test_format_get_tag
);
return
NULL
;
}
...
...
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