summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2013-07-16 20:41:15 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2013-07-18 10:54:50 -0400
commit01b20ab901a59db8c148504893db09b976c47c01 (patch)
treea9fd67f1621d339519568810114b83a44fe945b6 /tests
parent5def061d205867430b4acf490884f67456274242 (diff)
downloadgstreamer-plugins-good-01b20ab901a59db8c148504893db09b976c47c01.tar.gz
videocrop: Fix unit for GRAY16 formats
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/videocrop.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/check/elements/videocrop.c b/tests/check/elements/videocrop.c
index d7bfdfad4..a7bb46d2b 100644
--- a/tests/check/elements/videocrop.c
+++ b/tests/check/elements/videocrop.c
@@ -265,7 +265,8 @@ check_1x1_buffer (GstBuffer * buf, GstCaps * caps)
/* the exact values we check for come from videotestsrc */
static const guint yuv_values[] = { 81, 90, 240, 255 };
static const guint rgb_values[] = { 0xff, 0, 0, 255 };
- static const guint gray_values[] = { 0x51 };
+ static const guint gray8_values[] = { 0x51 };
+ static const guint gray16_values[] = { 0x5151 };
const guint *values;
guint i;
const GstVideoFormatInfo *finfo;
@@ -281,7 +282,10 @@ check_1x1_buffer (GstBuffer * buf, GstCaps * caps)
if (GST_VIDEO_INFO_IS_YUV (&info))
values = yuv_values;
else if (GST_VIDEO_INFO_IS_GRAY (&info))
- values = gray_values;
+ if (GST_VIDEO_FORMAT_INFO_BITS (finfo) == 8)
+ values = gray8_values;
+ else
+ values = gray16_values;
else
values = rgb_values;
@@ -316,7 +320,11 @@ check_1x1_buffer (GstBuffer * buf, GstCaps * caps)
val = val & ((1 << depth) - 1);
GST_DEBUG ("val %08x %d : %d", pixels, i, val);
- fail_unless_equals_int (val, values[i] >> (8 - depth));
+ if (depth <= 8) {
+ fail_unless_equals_int (val, values[i] >> (8 - depth));
+ } else {
+ fail_unless_equals_int (val, values[i] >> (16 - depth));
+ }
} else {
}
}