Re: [PATCH 6/7] tests/unit/test-throttle: Avoid unintended integer division

2024-03-12 Thread Thomas Huth
On 12/03/2024 19.38, Peter Maydell wrote: In test_compute_wait() we do double units = bkt.max / 10; which does an integer division and then assigns it to a double variable, and similarly later on in the expression for an assertion. Use 10.0 so that we do a floating point division and

[PATCH 6/7] tests/unit/test-throttle: Avoid unintended integer division

2024-03-12 Thread Peter Maydell
In test_compute_wait() we do double units = bkt.max / 10; which does an integer division and then assigns it to a double variable, and similarly later on in the expression for an assertion. Use 10.0 so that we do a floating point division and calculate the exact value, rather than doing an