libui: Fix clamping of uint32_t source values
It turned out that clamping was not working for conversions from
uint32_t values to int32_t values.
This adds a test to verify that conversion is handled correctly for that
case, along with correcting the logic for implementing the clamping.
The tests for the floating point source value case are also extended to
verify that source values near INT32_MAX and INT32_MIN are also handled
as correctly as possible, despite the seven bits of precision that are
lost.
Bug: 149495759
Test: atest Size_test
Change-Id: Iaa0560184e6c2dd0a9d288fff288fb159ee99f07
2 files changed