On Sun, Jan 31, 2021 at 9:14 PM Robert M. Münch <robert.mue...@saphirion.com> wrote: > > I have a C library with some test-cases (using googletest) that all pass. I > created Go bindings for the C lib and converted the tests to testify format. > > Some Go test fails because a return value from the C function (type float) is > different than expected. For example: > > ASSERT_FLOAT_EQ(10, GetHeight(root)); // C code works > > assert.EqualValues(t, 10, root.Height()) // Go code fails > The returned value in Go is: float32(1e+21) instead of float32(10). I'm > really wondering how this can happen. It looks like somewhere in the FFI, the > value changes. But what puzzles me, I'm using the same Go tests over and over > in other tests, and things are working. > > Does anyone have an idea what could be the problem?
We need more information. Can you show us a small self-contained program that demonstrates the problem? Please also tell us details about the system on which you are running. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXC7yoYeqLJppxSFvPqc8o%2BueP%3DkCL8TaufS_LgncOrDA%40mail.gmail.com.