Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gstreamer
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thibault Saunier
gstreamer
Commits
744687e5
Commit
744687e5
authored
May 22, 2019
by
Sebastian Dröge
🍵
Committed by
Benjamin Otte
May 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataurisrc: Add test that checks various URIs against their expected output
parent
73f6f466
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
1 deletion
+51
-1
tests/check/elements/dataurisrc.c
tests/check/elements/dataurisrc.c
+51
-1
No files found.
tests/check/elements/dataurisrc.c
View file @
744687e5
...
...
@@ -21,7 +21,7 @@
#include "config.h"
#endif
#include <gst/check/
gst
check.h>
#include <gst/check/check.h>
/* sine wave encoded in ogg/vorbis, created with:
* gst-launch-1.0 audiotestsrc num-buffers=110 ! audioconvert ! \
...
...
@@ -519,6 +519,55 @@ GST_START_TEST (test_dataurisrc_from_uri)
GST_END_TEST
;
GST_START_TEST
(
test_dataurisrc_uris
)
{
#define STRING_CONTENT(s) s, sizeof(s) - 1
static
const
struct
{
const
char
*
name
;
const
char
*
uri
;
const
char
*
mimetype
;
const
char
*
contents
;
gsize
contents_len
;
}
tests
[]
=
{
/* *INDENT-OFF* */
{
"simple"
,
"data:,HelloWorld"
,
NULL
,
STRING_CONTENT
(
"HelloWorld"
)},
{
"nodata"
,
"data:,"
,
NULL
,
STRING_CONTENT
(
""
)},
{
"case_sensitive"
,
"dATa:,HelloWorld"
,
NULL
,
STRING_CONTENT
(
"HelloWorld"
)},
{
"semicolon_after_comma"
,
"data:,;base64"
,
NULL
,
STRING_CONTENT
(
";base64"
)},
{
"mimetype"
,
"data:image/png,nopng"
,
"image/png"
,
STRING_CONTENT
(
"nopng"
)},
{
"charset_base64"
,
"data:text/plain;charset=ISO-8859-5;base64,wOPh29DdILjW0ePb0OLe0g=="
,
"text/plain"
,
STRING_CONTENT
(
"Руслан Ижбулатов"
)},
/* *INDENT-ON* */
};
gint
i
;
#undef STRING_CONTENT
for
(
i
=
0
;
i
<
G_N_ELEMENTS
(
tests
);
i
++
)
{
GstHarness
*
h
;
GstElement
*
src
;
GstBuffer
*
buf
;
src
=
gst_element_factory_make
(
"dataurisrc"
,
NULL
);
g_object_set
(
src
,
"uri"
,
tests
[
i
].
uri
,
NULL
);
h
=
gst_harness_new_with_element
(
src
,
NULL
,
"src"
);
gst_harness_play
(
h
);
buf
=
gst_harness_pull
(
h
);
fail_unless
(
buf
);
gst_check_buffer_data
(
buf
,
tests
[
i
].
contents
,
tests
[
i
].
contents_len
);
gst_buffer_unref
(
buf
);
gst_harness_teardown
(
h
);
gst_object_unref
(
src
);
}
}
GST_END_TEST
;
static
Suite
*
dataurisrc_suite
(
void
)
{
...
...
@@ -531,6 +580,7 @@ dataurisrc_suite (void)
tcase_add_test
(
tc_chain
,
test_dataurisrc_push
);
tcase_add_test
(
tc_chain
,
test_dataurisrc_uri_iface
);
tcase_add_test
(
tc_chain
,
test_dataurisrc_from_uri
);
tcase_add_test
(
tc_chain
,
test_dataurisrc_uris
);
return
s
;
}
...
...
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