Bug 181130 - [libc] HN_DECIMAL failures with humanize_number
Summary: [libc] HN_DECIMAL failures with humanize_number
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-08 04:50 UTC by Enji Cooper
Modified: 2018-01-03 05:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2013-08-08 04:50:00 UTC
These are several failures reported by the ATF test regarding humanize number. The breakdown is as follows:

tc-se:humanize_number("1 K", 5, 1000, "", HN_AUTOSCALE, HN_B) = 3, but got 3/[1 k]
tc-se:*** Check failed: Failed for table entry 11

^^ This should display with the appropriate prefix (K, not k). ^^

tc-se:humanize_number("", 6, 1000, "A", HN_AUTOSCALE, HN_DECIMAL) = -1, but got
tc-se:    4/[1 kA]
tc-se:*** Check failed: Failed for table entry 12

^^ This should fail because it would truncate the value ^^

tc-se:humanize_number("1.0G", 5, 1048258238, "", HN_AUTOSCALE,
tc-se:    HN_DECIMAL|HN_NOSPACE|HN_B) = 4, but got 4/[999M]
tc-se:*** Check failed: Failed for table entry 13
tc-se:humanize_number("1.0M", 5, 1023488, "", HN_AUTOSCALE,
tc-se:    HN_DECIMAL|HN_NOSPACE|HN_B) = 4, but got 4/[999k]
tc-se:*** Check failed: Failed for table entry 14
tc-se:humanize_number("1.0M", 5, 1023999, "", HN_AUTOSCALE,
tc-se:    HN_DECIMAL|HN_NOSPACE|HN_B) = 4, but got 2/[1M]

^^ These should be properly rounded up and have appropriate decimal places ^^
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:11 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped