[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I test functions that return float/double?


in the mean time...

	assert_true(abs(actual - expected) < delta)

--------------------------------------------------------------------------
James Grenning - Author of TDD for Embedded C - wingman-sw.com/tddec
wingman-sw.com
wingman-sw.com/blog
twitter.com/jwgrenning
facebook.com/wingman.sw
[![wingman software](http://www.wingman-sw.com/images/wingman.png)](http://wingman-sw.com)
On 4 Dec 2015, at 7:58, Andreas Schneider wrote:

On Thursday 03 December 2015 11:45:31 Pötter, Lars wrote:
Junit has:

public static void assertEquals(double expected,
                             double actual,
                             double delta)

http://junit.org/apidocs/org/junit/Assert.html#assertEquals%28double,%20doub
le,%20double%29

I checked :
https://api.cmocka.org/group__cmocka__asserts.html

But I did not find anything comparable. Is there a trick or did I miss
something?

Patches are welcome ;)


	-- andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


References:
How do I test functions that return float/double?Pötter, Lars <LPoetter@xxxxxxxxx>
Re: How do I test functions that return float/double?Andreas Schneider <asn@xxxxxxxxxxxxxx>