Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
381f7a66
Commit
381f7a66
authored
Dec 19, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: add some file test cases
parent
8cd7277c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
modules/access/http/file_test.c
modules/access/http/file_test.c
+35
-0
No files found.
modules/access/http/file_test.c
View file @
381f7a66
...
...
@@ -165,10 +165,45 @@ int main(void)
assert
(
vlc_http_file_seek
(
f
,
offset
=
1234
)
==
0
);
vlc_http_file_destroy
(
f
);
/* Invalid responses */
replies
[
0
]
=
"HTTP/1.1 206 Partial Content
\r\n
"
"Content-Type: multipart/byteranges
\r\n
"
"
\r\n
"
;
offset
=
0
;
f
=
vlc_http_file_create
(
NULL
,
url
,
ua
,
NULL
);
assert
(
f
!=
NULL
);
assert
(
vlc_http_file_get_size
(
f
)
==
(
uintmax_t
)
-
1
);
replies
[
0
]
=
"HTTP/1.1 206 Partial Content
\r\n
"
"Content-Range: seconds 60-120/180
\r\n
"
"
\r\n
"
;
assert
(
vlc_http_file_seek
(
f
,
0
)
==
-
1
);
/* Incomplete range */
replies
[
0
]
=
"HTTP/1.1 206 Partial Content
\r\n
"
"Content-Range: bytes 0-1233/*
\r\n
"
"
\r\n
"
;
assert
(
vlc_http_file_seek
(
f
,
0
)
==
0
);
assert
(
vlc_http_file_get_size
(
f
)
==
1234
);
/* Extraneous range */
replies
[
0
]
=
"HTTP/1.1 200 OK
\r\n
"
"Content-Range: bytes 0-1233/1234
\r\n
"
"
\r\n
"
;
assert
(
vlc_http_file_seek
(
f
,
0
)
==
0
);
assert
(
vlc_http_file_get_size
(
f
)
==
(
uintmax_t
)
-
1
);
vlc_http_file_destroy
(
f
);
/* Dummy API calls */
f
=
vlc_http_file_create
(
NULL
,
"ftp://localhost/foo"
,
NULL
,
NULL
);
assert
(
f
==
NULL
);
f
=
vlc_http_file_create
(
NULL
,
"/foo"
,
NULL
,
NULL
);
assert
(
f
==
NULL
);
f
=
vlc_http_file_create
(
NULL
,
"http://www.example.com"
,
NULL
,
NULL
);
assert
(
f
!=
NULL
);
vlc_http_file_destroy
(
f
);
return
0
;
}
...
...
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