Hi Shuvam!

I see that there already is discussion going on around patches
like this (from your Link: fields)

So I am going to try and keep this
as low drama as possible 

Okay, the one thing I will say about this, is I particularly like
these tests. They are very very smart and "gnarly" :-)

Like for example, 

+       /* binary values stay in bytes until the 1 KiB boundary */
+       test_string_get_size_one(1000, 1, "1.00 kB", "1000 B");
+       test_string_get_size_one(1018, 1, "1.02 kB", "1018 B");
+       test_string_get_size_one(1023, 1, "1.02 kB", "1023 B");
+       test_string_get_size_one(1024, 1, "1.02 kB", "1.00 KiB");
+       test_string_get_size_one(1025, 1, "1.03 kB", "1.00 KiB");

That is a INCREDIBLY smart edge case.  (I probably wouldn't think of this)

Or even

+       /* binary rounding around 1000 KiB */
+       test_string_get_size_one(1023487, 1, "1.02 MB", "999 KiB");
+       test_string_get_size_one(1023488, 1, "1.02 MB", "1000 KiB");
+       test_string_get_size_one(1024000, 1, "1.02 MB", "1000 KiB");
+       test_string_get_size_one(1024511, 1, "1.02 MB", "1000 KiB");
+       test_string_get_size_one(1024512, 1, "1.02 MB", "1001 KiB");

Again, smart. I like these tests.


So, you (more) than deserve these tags, as I tested it too :) :

Reviewed-by: Josh Law <[email protected]>
Tested-by: Josh Law <[email protected]>

Reply via email to