Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
esp
mongoose
Commits
d73aa1ad
Commit
d73aa1ad
authored
Jan 31, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added skeleton for regex checks
parent
d5bc58c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
unit_test.c
test/unit_test.c
+23
-0
No files found.
test/unit_test.c
View file @
d73aa1ad
...
...
@@ -516,6 +516,28 @@ static void test_alloc_vprintf(void) {
free
(
p
);
}
static
void
test_request_replies
(
void
)
{
char
ebuf
[
100
];
int
i
,
port
=
atoi
(
HTTPS_PORT
);
struct
mg_connection
*
conn
;
struct
mg_context
*
ctx
;
static
struct
{
const
char
*
request
,
*
reply_regex
;
}
tests
[]
=
{
{
"GET test/hello.txt HTTP/1.0
\r\n
Range: bytes=3-5
\r\n\r\n
"
,
"^HTTP/1.1 206 Partial Content"
},
{
NULL
,
NULL
},
};
ASSERT
((
ctx
=
mg_start
(
event_handler
,
NULL
,
OPTIONS
))
!=
NULL
);
for
(
i
=
0
;
tests
[
i
].
request
!=
NULL
;
i
++
)
{
ASSERT
((
conn
=
mg_download
(
"localhost"
,
port
,
1
,
ebuf
,
sizeof
(
ebuf
),
"%s"
,
tests
[
i
].
request
))
!=
NULL
);
mg_close_connection
(
conn
);
}
mg_stop
(
ctx
);
}
int
__cdecl
main
(
void
)
{
test_alloc_vprintf
();
test_base64_encode
();
...
...
@@ -531,6 +553,7 @@ int __cdecl main(void) {
test_mg_stat
();
test_skip_quoted
();
test_mg_upload
();
test_request_replies
();
#ifdef USE_LUA
test_lua
();
#endif
...
...
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