copilot icon indicating copy to clipboard operation
copilot copied to clipboard

Fix printf format for numbers in testing suite

Open fdedden opened this issue 5 years ago • 1 comments

By mistake the printing of large number does not work correctly in the driver of the test suite. The reason is that even the largest numbers are printed with %d, which should be prepended with an l. Additionally, %u should be used for unsigned numbers.

Ideally this should all be platform independent (so we can test other architectures as well). Printing numbers using printf in C is however not easily translated to other architectures, as the size of a long, for example, might be different on other platforms. The C99 standard helps in using with the macro's defined in <inttypes.h>, these should be used as soon as our C99 implementation supports macros.

fdedden avatar May 20 '20 11:05 fdedden

Just made an in between merge with master to implement the first fix of printing numbers. Only when the suite is made architecture independent, we can close the issue.

fdedden avatar May 20 '20 12:05 fdedden

These tests were removed in 21c000b34552b8f47f135dad87f372973f4f9dec. I think this issue no longer applies.

The tests are being revisited in #413. There are probably ideas that need to be rescued. Making a note because this is relevant.

ivanperez-keera avatar Mar 09 '23 07:03 ivanperez-keera