如何使用Cgreen在精度范围内进行测试?

How to test within a precision using Cgreen?

我需要在使用 Cgreen 编写的单元测试中测试双打。我的比较和生成的值非常接近,但是 assert_double_equal

1.95 != 1.94887879

如何让Cgreen在一定精度内进行测试?这对我来说足够接近了。

PS:Whosebug 不允许我为 Cgreen 创建新标签,但我希望一些 CUnit 用户有一些使用它的经验。

significant_figures_for_assert_double_are(int figures)

发件人:

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