Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/gen Explicitly test for PR lib/54053



details:   https://anonhg.NetBSD.org/src/rev/ba759855b3be
branches:  trunk
changeset: 449579:ba759855b3be
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Mar 11 17:45:12 2019 +0000

description:
Explicitly test for PR lib/54053

A suitable test was actually there already - but the results
were not verified.   So just add a test that the result string
is what is expected.  (Previously for len==128 and bytes==10000
it would  have returned "0E" now it returns 10000 as it should.)

diffstat:

 tests/lib/libc/gen/t_humanize_number.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 50bc87eab58e -r ba759855b3be tests/lib/libc/gen/t_humanize_number.c
--- a/tests/lib/libc/gen/t_humanize_number.c    Mon Mar 11 15:10:51 2019 +0000
+++ b/tests/lib/libc/gen/t_humanize_number.c    Mon Mar 11 17:45:12 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_humanize_number.c,v 1.9 2017/01/10 15:20:44 christos Exp $   */
+/*     $NetBSD: t_humanize_number.c,v 1.10 2019/03/11 17:45:12 kre Exp $       */
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -287,6 +287,11 @@
 
        ATF_REQUIRE(rv != -1);
        ATF_REQUIRE(strcmp(buf, "0%d%s%d%s%s%s") != 0);
+       /*
+        * PR lib/54053: before version 1.18 the output was nonsense
+        * with HN_AUTOSCALE and a buffer big enough to not need scaling
+        */
+       ATF_REQUIRE(strcmp(buf, "10000") == 0);
 
        /*
         * Tight buffer.



Home | Main Index | Thread Index | Old Index