Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
8797fd3d
Commit
8797fd3d
authored
Oct 04, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debloat the vtim test
parent
ee681132
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
29 deletions
+19
-29
vtim.c
lib/libvarnish/vtim.c
+19
-29
No files found.
lib/libvarnish/vtim.c
View file @
8797fd3d
...
...
@@ -529,12 +529,26 @@ bench()
e
-
s
,
i
,
1e9
*
(
e
-
s
)
/
i
,
t
);
}
void
parse_check
(
time_t
t
,
const
char
*
s
)
{
double
tt
;
char
buf
[
BUFSIZ
];
tt
=
VTIM_parse
(
s
);
if
(
tt
!=
t
)
{
VTIM_format
(
tt
,
buf
);
printf
(
" fm: %12jd <%s>
\n
"
,
(
intmax_t
)
t
,
s
);
printf
(
" to: %12.0f <%s>
\n
"
,
tt
,
buf
);
exit
(
2
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
time_t
t
;
struct
tm
tm
;
double
tt
;
char
buf
[
BUFSIZ
];
char
buf1
[
BUFSIZ
];
...
...
@@ -553,41 +567,17 @@ main(int argc, char **argv)
buf1
,
buf
,
(
intmax_t
)
t
);
exit
(
2
);
}
tt
=
VTIM_parse
(
buf1
);
if
(
tt
!=
t
)
{
VTIM_format
(
tt
,
buf
);
printf
(
" fm: %12jd <%s>
\n
"
,
(
intmax_t
)
t
,
buf1
);
printf
(
" to: %12.0f <%s>
\n
"
,
tt
,
buf
);
exit
(
2
);
}
parse_check
(
t
,
buf1
);
strftime
(
buf1
,
sizeof
buf1
,
"%a %b %e %T %Y"
,
&
tm
);
tt
=
VTIM_parse
(
buf1
);
if
(
tt
!=
t
)
{
VTIM_format
(
tt
,
buf
);
printf
(
" fm: %12jd <%s>
\n
"
,
(
intmax_t
)
t
,
buf1
);
printf
(
" to: %12.0f <%s>
\n
"
,
tt
,
buf
);
exit
(
2
);
}
parse_check
(
t
,
buf1
);
strftime
(
buf1
,
sizeof
buf1
,
"%Y-%m-%dT%T"
,
&
tm
);
tt
=
VTIM_parse
(
buf1
);
if
(
tt
!=
t
)
{
VTIM_format
(
tt
,
buf
);
printf
(
" fm: %12jd <%s>
\n
"
,
(
intmax_t
)
t
,
buf1
);
printf
(
" to: %12.0f <%s>
\n
"
,
tt
,
buf
);
exit
(
2
);
}
parse_check
(
t
,
buf1
);
if
(
tm
.
tm_year
>=
69
&&
tm
.
tm_year
<
169
)
{
strftime
(
buf1
,
sizeof
buf1
,
"%A, %d-%b-%y %T GMT"
,
&
tm
);
tt
=
VTIM_parse
(
buf1
);
if
(
tt
!=
t
)
{
VTIM_format
(
tt
,
buf
);
printf
(
" fm: %12jd <%s>
\n
"
,
(
intmax_t
)
t
,
buf1
);
printf
(
" to: %12.0f <%s>
\n
"
,
tt
,
buf
);
exit
(
2
);
}
parse_check
(
t
,
buf1
);
}
}
...
...
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