u-boot/test/lib
Pali Rohár d179018e4c display_options: print_size: Fix order overflow
Function print_size() round size to the nearst value with one decimal
fraction number. But in special cases also unit order may overflow.

For example value 1073689396 is printed as "1024 MiB" and value 1073741824
as "1 GiB".

Fix this issue by detecting order overflow and increasing unit order.
With this change also value 1073689396 is printed as "1 GiB".

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-23 15:13:18 -04:00
..
abuf.c abuf: Correct a corner case with abuf_realloc() 2022-04-06 14:01:42 -04:00
asn1.c lib/crypto, efi_loader: move some headers to include/crypto 2020-05-04 12:26:11 +02:00
cmd_ut_lib.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
efi_device_path.c test: unit test for efi_dp_check_length() 2020-08-24 16:37:53 +02:00
efi_image_region.c test: provide tests for efi_image_region_add() 2020-07-03 18:03:41 +02:00
getopt.c test: Add a test for getopt 2020-10-30 10:56:11 -04:00
hexdump.c test: call hexdump tests via ut lib 2019-04-22 18:13:21 -04:00
Kconfig test: Add some tests for kconfig.h 2022-08-10 13:38:30 -04:00
kconfig.c test: Add some tests for kconfig.h 2022-08-10 13:38:30 -04:00
kconfig_spl.c test: Add some tests for kconfig.h 2022-08-10 13:38:30 -04:00
lmb.c lmb: remove lmb_is_nomap() from include 2021-11-20 10:53:00 +01:00
longjmp.c test: unit test for longjmp 2021-04-08 15:37:29 +08:00
Makefile test: Add some tests for kconfig.h 2022-08-10 13:38:30 -04:00
rsa.c test: add rsa_verify() unit test 2020-03-12 08:20:39 -04:00
sscanf.c lib: sscanf: add sscanf implementation 2020-08-14 15:18:30 -04:00
string.c lib: Add memdup() 2021-10-08 15:53:26 -04:00
strlcat.c test: Fix size_t formats in strlcat test 2021-07-27 10:34:27 +09:00
test_aes.c common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
test_crypt.c lib: wrap crypt API to hide errno usage 2021-07-23 13:36:20 -04:00
test_errno_str.c test: provide test for errno_str() 2019-10-31 07:22:53 -04:00
test_print.c display_options: print_size: Fix order overflow 2022-09-23 15:13:18 -04:00