tests: audioconvert: fix test compilation with clang

With clang 3.7.1 on FreeBSD:
elements/audioconvert.c:650:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
       ~~~ ^

https://bugzilla.gnome.org/show_bug.cgi?id=760134
This commit is contained in:
Koop Mast 2016-01-06 01:04:31 +00:00 committed by Tim-Philipp Müller
parent e5fb7275c2
commit 17b16e7a83

View file

@ -647,9 +647,9 @@ GST_START_TEST (test_int_conversion)
gint32 in[] = { 0, G_MININT32, G_MAXINT32, gint32 in[] = { 0, G_MININT32, G_MAXINT32,
(32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15), (32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15),
(32 << 16) + (2 << 15), (32 << 16) - (2 << 15), (32 << 16) + (2 << 15), (32 << 16) - (2 << 15),
(-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), (-(32 << 16)) + (1 << 15), (-(32 << 16)) - (1 << 15),
(-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15), (-(32 << 16)) + (2 << 15), (-(32 << 16)) - (2 << 15),
(-32 << 16) (-(32 << 16))
}; };
gint16 out[] = { 0, G_MININT16, G_MAXINT16, gint16 out[] = { 0, G_MININT16, G_MAXINT16,
32, 33, 32, 32, 33, 32,
@ -670,9 +670,9 @@ GST_START_TEST (test_int_conversion)
gint32 in[] = { 0, G_MININT32, G_MAXINT32, gint32 in[] = { 0, G_MININT32, G_MAXINT32,
(32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15), (32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15),
(32 << 16) + (2 << 15), (32 << 16) - (2 << 15), (32 << 16) + (2 << 15), (32 << 16) - (2 << 15),
(-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), (-(32 << 16)) + (1 << 15), (-(32 << 16)) - (1 << 15),
(-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15), (-(32 << 16)) + (2 << 15), (-(32 << 16)) - (2 << 15),
(-32 << 16) (-(32 << 16))
}; };
guint16 out[] = { (1 << 15), 0, G_MAXUINT16, guint16 out[] = { (1 << 15), 0, G_MAXUINT16,
(1 << 15) + 32, (1 << 15) + 33, (1 << 15) + 32, (1 << 15) + 32, (1 << 15) + 33, (1 << 15) + 32,
@ -812,9 +812,9 @@ GST_START_TEST (test_int_float_conversion)
{ {
gint16 in[] = { 0, -32768, 16384, -16384 }; gint16 in[] = { 0, -32768, 16384, -16384 };
gdouble out[] = { 0.0, gdouble out[] = { 0.0,
(gdouble) (-32768L << 16) / 2147483648.0, /* ~ -1.0 */ (gdouble) (-(32768L << 16)) / 2147483648.0, /* ~ -1.0 */
(gdouble) (16384L << 16) / 2147483648.0, /* ~ 0.5 */ (gdouble) (16384L << 16) / 2147483648.0, /* ~ 0.5 */
(gdouble) (-16384L << 16) / 2147483648.0, /* ~ -0.5 */ (gdouble) (-(16384L << 16)) / 2147483648.0, /* ~ -0.5 */
}; };
RUN_CONVERSION ("16 signed to 64 float", RUN_CONVERSION ("16 signed to 64 float",
@ -822,11 +822,11 @@ GST_START_TEST (test_int_float_conversion)
out, get_float_caps (1, G_BYTE_ORDER, 64)); out, get_float_caps (1, G_BYTE_ORDER, 64));
} }
{ {
gint32 in[] = { 0, (-1L << 31), (1L << 30), (-1L << 30) }; gint32 in[] = { 0, (-(1L << 31)), (1L << 30), (-(1L << 30)) };
gdouble out[] = { 0.0, gdouble out[] = { 0.0,
(gdouble) (-1L << 31) / 2147483648.0, /* ~ -1.0 */ (gdouble) (-(1L << 31)) / 2147483648.0, /* ~ -1.0 */
(gdouble) (1L << 30) / 2147483648.0, /* ~ 0.5 */ (gdouble) (1L << 30) / 2147483648.0, /* ~ 0.5 */
(gdouble) (-1L << 30) / 2147483648.0, /* ~ -0.5 */ (gdouble) (-(1L << 30)) / 2147483648.0, /* ~ -0.5 */
}; };
RUN_CONVERSION ("32 signed to 64 float", RUN_CONVERSION ("32 signed to 64 float",
@ -1067,9 +1067,9 @@ GST_START_TEST (test_passthrough)
gint32 data[] = { 0, G_MININT32, G_MAXINT32, gint32 data[] = { 0, G_MININT32, G_MAXINT32,
(32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15), (32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15),
(32 << 16) + (2 << 15), (32 << 16) - (2 << 15), (32 << 16) + (2 << 15), (32 << 16) - (2 << 15),
(-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), (-(32 << 16)) + (1 << 15), (-(32 << 16)) - (1 << 15),
(-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15), (-(32 << 16)) + (2 << 15), (-(32 << 16)) - (2 << 15),
(-32 << 16) (-(32 << 16))
}; };
RUN_CONVERSION ("int 32 bit signed passthrough", RUN_CONVERSION ("int 32 bit signed passthrough",
data, get_int_caps (1, G_BYTE_ORDER, 32, 32, TRUE), data, get_int_caps (1, G_BYTE_ORDER, 32, 32, TRUE),