gst_value_compare_double_range (const GValue * value1, const GValue * value2)
{
if (value2->data[0].v_double == value1->data[0].v_double &&
- value2->data[0].v_double == value1->data[0].v_double)
+ value2->data[1].v_double == value1->data[1].v_double)
return GST_VALUE_EQUAL;
return GST_VALUE_UNORDERED;
}
/* double_range <-> double_range
*/
+ /* Check equality */
+ g_value_init (&src1, GST_TYPE_DOUBLE_RANGE);
+ gst_value_set_double_range (&src1, 10.0, 20.0);
+ g_value_init (&src2, GST_TYPE_DOUBLE_RANGE);
+ gst_value_set_double_range (&src2, 10.0, 15.0);
+ /* They are not equal (higher bound is different */
+ fail_if (gst_value_compare (&src1, &src2) == GST_VALUE_EQUAL);
+ g_value_unset (&src1);
+ /* They are not equal (lower bound is different */
+ g_value_init (&src1, GST_TYPE_DOUBLE_RANGE);
+ gst_value_set_double_range (&src1, 5.0, 15.0);
+ fail_if (gst_value_compare (&src1, &src2) == GST_VALUE_EQUAL);
+ g_value_unset (&src1);
+ /* And finally check equality */
+ g_value_init (&src1, GST_TYPE_DOUBLE_RANGE);
+ gst_value_set_double_range (&src1, 10.0, 15.0);
+ fail_unless (gst_value_compare (&src1, &src2) == GST_VALUE_EQUAL);
+ g_value_unset (&src1);
+ g_value_unset (&src2);
+
/* same range, empty set */
g_value_init (&src1, GST_TYPE_DOUBLE_RANGE);
gst_value_set_double_range (&src1, 10.0, 20.0);