Date: Sun, 23 Dec 2012 00:32:20 -0800 From: John-Mark Gurney <jmg@funkthat.com> To: hackers@FreeBSD.org Subject: looking for someone to fix humanize_number (test cases included) Message-ID: <20121223083220.GL1563@funkthat.com>
next in thread | raw e-mail | index | archive | help
I'm looking for a person who is interested in fixing up humanize_number. The other day I copied some data from a 7.2-R box to a 9.1-stable box and did a du -shc and a du-skc to check the results... I noticed the -h run dropped from 11M to 10M, which I thought was weird... Then I looked at the results from the -k run, but the new machine had a larger result (I copied from UFS to ZFS)... It turns out that humanize_number was broken when doing rounding... No longer does humanize_number round up at .5 or more of the prefix.. So I decided to write a test program to test the output, and now I'm even more surprised by the output... Neither 7.2-R nor 10-current give what I expect are the correct results... Feel free to take a look at the test program posted to: http://people.freebsd.org/~jmg/humanize_numbers/ The .c contains what I think the output should be. So far the bugs I know of: 1) rounding is incorrect (started this whole search) 2) buffer calculation is incorrect in some cases, index 11 should fit but doesn't 3) some cases zero is returned though it isn't zero, more like 0T for 512 G (indexes 16, 17, 22, 23) 4) man page is missing required sys/types.h include I'll work to get the code into the tree once we get it in a good state. Please cc me as I'm not subscribed to -hackers. Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121223083220.GL1563>