Original commit message from CVS:
* libs/gst/check/Makefile.am:
* libs/gst/check/gstcheck.h:
* pkgconfig/gstreamer-check-uninstalled.pc.in:
* pkgconfig/gstreamer-check.pc.in:
Ugly 'fix' for the controller unit test on the p5 bot: in
fail_unless_equals_float() check whether the values are 'almost
equal' by allowing a small absolute error, which should be good
enough for our use cases (normal numbers and values close to 0).
Proper fixage left to floating point arithmetic aficionados.
+2007-06-14 Tim-Philipp Müller <tim at centricular dot net>
+
+ * libs/gst/check/Makefile.am:
+ * libs/gst/check/gstcheck.h:
+ * pkgconfig/gstreamer-check-uninstalled.pc.in:
+ * pkgconfig/gstreamer-check.pc.in:
+ Ugly 'fix' for the controller unit test on the p5 bot: in
+ fail_unless_equals_float() check whether the values are 'almost
+ equal' by allowing a small absolute error, which should be good
+ enough for our use cases (normal numbers and values close to 0).
+ Proper fixage left to floating point arithmetic aficionados.
+
2007-06-14 Stefan Kost <ensonic@users.sf.net>
* libs/gst/base/gstbasesink.c: (gst_base_sink_reset_qos),
2007-06-14 Stefan Kost <ensonic@users.sf.net>
* libs/gst/base/gstbasesink.c: (gst_base_sink_reset_qos),
libgstcheck_@GST_MAJORMINOR@_la_CFLAGS = $(GST_OBJ_CFLAGS) $(CHECK_CFLAGS)
libgstcheck_@GST_MAJORMINOR@_la_LIBADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) \
libgstcheck_@GST_MAJORMINOR@_la_CFLAGS = $(GST_OBJ_CFLAGS) $(CHECK_CFLAGS)
libgstcheck_@GST_MAJORMINOR@_la_LIBADD = $(GST_OBJ_LIBS) $(CHECK_LIBS) \
- $(top_builddir)/gst/libgstreamer-@GST_MAJORMINOR@.la
+ $(top_builddir)/gst/libgstreamer-@GST_MAJORMINOR@.la -lm
libgstcheck_@GST_MAJORMINOR@_la_LDFLAGS = -Wl,--export-dynamic \
libgstbase_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
libgstcheck_@GST_MAJORMINOR@_la_LDFLAGS = -Wl,--export-dynamic \
libgstbase_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
* @a: a #gdouble or #gfloat value or expression
* @b: a #gdouble or #gfloat value or expression
*
* @a: a #gdouble or #gfloat value or expression
* @b: a #gdouble or #gfloat value or expression
*
- * This macro checks that @a and @b are equal and aborts if this is not the
- * case, printing both expressions and the values they evaluated to. This
- * macro is for use in unit tests.
+ * This macro checks that @a and @b are (almost) equal and aborts if this
+ * is not the case, printing both expressions and the values they evaluated
+ * to. This macro is for use in unit tests.
G_STMT_START { \
double first = a; \
double second = b; \
G_STMT_START { \
double first = a; \
double second = b; \
- fail_unless(first == second, \
- "'" #a "' (%f) is not equal to '" #b"' (%f)", first, second); \
+ /* This will only work for 'normal' values and values around 0, \
+ * which should be good enough for our purposes here */ \
+ fail_unless(fabs (first - second) < 0.0000001, \
+ "'" #a "' (%g) is not equal to '" #b "' (%g)", first, second);\
/**
* assert_equals_float:
* @a: a #gdouble or #gfloat value or expression
* @b: a #gdouble or #gfloat value or expression
*
/**
* assert_equals_float:
* @a: a #gdouble or #gfloat value or expression
* @b: a #gdouble or #gfloat value or expression
*
- * This macro checks that @a and @b are equal and aborts if this is not the
- * case, printing both expressions and the values they evaluated to. This
- * macro is for use in unit tests.
+ * This macro checks that @a and @b are (almost) equal and aborts if this
+ * is not the case, printing both expressions and the values they evaluated
+ * to. This macro is for use in unit tests.
Requires: gstreamer-@GST_MAJORMINOR@ = @VERSION@
Version: @VERSION@
Requires: gstreamer-@GST_MAJORMINOR@ = @VERSION@
Version: @VERSION@
-Libs: ${libdir}/libgstcheck-@GST_MAJORMINOR@.la @CHECK_LIBS@
+Libs: ${libdir}/libgstcheck-@GST_MAJORMINOR@.la @CHECK_LIBS@ -lm
Description: Unit testing helper library for GStreamer modules
Requires: gstreamer-@GST_MAJORMINOR@
Version: @VERSION@
Description: Unit testing helper library for GStreamer modules
Requires: gstreamer-@GST_MAJORMINOR@
Version: @VERSION@
-Libs: -L${libdir} -lgstcheck-@GST_MAJORMINOR@ @CHECK_LIBS@
+Libs: -L${libdir} -lgstcheck-@GST_MAJORMINOR@ @CHECK_LIBS@ -lm