From nobody@FreeBSD.org  Thu Aug  8 03:42:52 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 5C455D68
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Aug 2013 03:42:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 4A4D020C1
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Aug 2013 03:42:52 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r783gqp0021411
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 Aug 2013 03:42:52 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r783gqnr021410;
	Thu, 8 Aug 2013 03:42:52 GMT
	(envelope-from nobody)
Message-Id: <201308080342.r783gqnr021410@oldred.freebsd.org>
Date: Thu, 8 Aug 2013 03:42:52 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: HN_DECIMAL failures with humanize_number
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181130
>Category:       kern
>Synopsis:       [libc] HN_DECIMAL failures with humanize_number
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 08 03:50:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Fri Aug 09 01:30:01 UTC 2013
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #10 c9d2bd6-dirty: Wed Aug  7 18:55:03 PDT 2013     root@fuji-current.local:/usr/obj/usr/src/sys/FUJI-NOCOMPAT  i386
>Description:
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 ^^
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
