summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2015-06-01 11:12:22 -0300
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2015-06-01 12:33:41 -0300
commit8f2b65c74df60f77da0af9cdb35182d0ff99a3f6 (patch)
tree23d7e7441206aefaa9bc525c91e0253a4770d551 /tests
parent4cca6efda8837aa3fafb45c68cc0371e280c1e6e (diff)
tests: zbar: check for frame field on attach-frame=true
Also check for the sample to have a buffer and caps associated with it. Related to: https://bugzilla.gnome.org/show_bug.cgi?id=747557
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/zbar.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/check/elements/zbar.c b/tests/check/elements/zbar.c
index 0566d7e40..9c8284d65 100644
--- a/tests/check/elements/zbar.c
+++ b/tests/check/elements/zbar.c
@@ -25,6 +25,7 @@ GST_START_TEST (test_still_image)
GstMessage *zbar_msg = NULL;
const GstStructure *s;
GstElement *pipeline, *src, *dec, *csp, *zbar, *sink;
+ GstSample *sample;
const gchar *type, *symbol;
gchar *path;
int qual;
@@ -37,6 +38,8 @@ GST_START_TEST (test_still_image)
zbar = gst_element_factory_make ("zbar", NULL);
sink = gst_element_factory_make ("fakesink", NULL);
+ g_object_set (zbar, "attach-frame", TRUE, NULL);
+
path = g_build_filename (GST_TEST_FILES_PATH, "barcode.png", NULL);
GST_LOG ("reading file '%s'", path);
g_object_set (src, "location", path, NULL);
@@ -79,6 +82,7 @@ GST_START_TEST (test_still_image)
fail_unless (gst_structure_has_field (s, "type"));
fail_unless (gst_structure_has_field (s, "symbol"));
fail_unless (gst_structure_has_field (s, "quality"));
+ fail_unless (gst_structure_has_field (s, "frame"));
fail_unless (gst_structure_get_int (s, "quality", &qual));
fail_unless (qual >= 90);
type = gst_structure_get_string (s, "type");
@@ -86,6 +90,11 @@ GST_START_TEST (test_still_image)
symbol = gst_structure_get_string (s, "symbol");
fail_unless_equals_string (symbol, "9876543210128");
+ fail_unless (gst_structure_get (s, "frame", GST_TYPE_SAMPLE, &sample, NULL));
+ fail_unless (gst_sample_get_buffer (sample));
+ fail_unless (gst_sample_get_caps (sample));
+ gst_sample_unref (sample);
+
fail_unless_equals_int (gst_element_set_state (pipeline, GST_STATE_NULL),
GST_STATE_CHANGE_SUCCESS);