How do I check for accuracy with Cgreen?

I need to check for doubles in a unit test written using Cgreen. My comparisons and generated values ​​are very close, but assert_double_equal

says

1.95 != 1.94887879

      

How can I tell Cgreen to check with a certain precision? It's close enough for me.

PS: Stackoverflow won't let me create a new tag for Cgreen, but I hope some CUnit users have some experience with it.

+3


source to share


1 answer


significant_figures_for_assert_double_are(int figures)

From:



http://cgreen.sourceforge.net/index.php/documentation/building-test-suites-with-cgreen

+4


source







All Articles