OSC: Make pan controls work properly with MB too.
[ardour.git] / libs / ardour / test / dsp_load_calculator_test.cc
index f4ce68220ced0624c4c3026a3ceb6b036a389350..6b774e5b48019f3c91bb3fbf721f732d70637b52 100644 (file)
@@ -6,6 +6,23 @@
 
 CPPUNIT_TEST_SUITE_REGISTRATION (DSPLoadCalculatorTest);
 
+
+#if defined(PLATFORM_WINDOWS) && defined(COMPILER_MINGW)
+/* cppunit-1.13.2  uses assertion_traits<double>
+ *    sprintf( , "%.*g", precision, x)
+ * to format a double. The actual comparison is performed on a string.
+ * This is problematic with mingw/windows|wine, "%.*g" formatting fails.
+ *
+ * This quick hack compares float, however float compatisons are at most Y.MMMM+eXX,
+ * the max precision needs to be limited. to the last mantissa digit.
+ *
+ * Anyway, actual maths is verified with Linux and OSX unit-tests,
+ * and this needs to go to https://sourceforge.net/p/cppunit/bugs/
+ */
+#include <math.h>
+#define CPPUNIT_ASSERT_DOUBLES_EQUAL(A,B,P) CPPUNIT_ASSERT_EQUAL((float)rint ((A) / (P)),(float)rint ((B) / (P)))
+#endif
+
 using namespace std;
 using namespace ARDOUR;