dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #15206
[Bug 425729] Re: Function unit test fails on Windows
I changed it now to use CPPUNIT_ASSERT_DOUBLES_EQUAL as suggested by
Garth.
I think this bug can be closed.
--
Function unit test fails on Windows
https://bugs.launchpad.net/bugs/425729
You received this bug notification because you are subscribed to DOLFIN.
Status in DOLFIN: Fix Committed
Bug description:
Hi,
When running the function unit test on Windows I get a failure:
C:\fenicsslave\src\dolfin\test\unit\function\cpp>test
test.cpp:60:Assertion
Test name: Eval::testArbitraryEval
assertion failed
- Expression: u[0] == sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2])
Failures !!!
Run: 1 Failure total: 1 Failures: 1 Errors: 0
I have printed both expressions and they seem to be the same but CPPUNIT_ASSERT still reports a failure. A simple fix is to use CPPUNIT_ASSERT_EQUAL instead of CPPUNIT_ASSERT:
// Test evaluation of a user-defined function
f0.eval(&u[0], data);
- CPPUNIT_ASSERT(u[0] == sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2]));
+ CPPUNIT_ASSERT_EQUAL(u[0], sin(3.0*x[0])*sin(3.0*x[1])*sin(3.0*x[2]));
#ifdef HAS_GTS
// Test evaluation of a discrete function
Johannes
References