Module Name: src
Committed By: kre
Date: Mon Mar 11 17:45:12 UTC 2019
Modified Files:
src/tests/lib/libc/gen: t_humanize_number.c
Log Message:
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.)
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/gen/t_humanize_number.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/gen/t_humanize_number.c
diff -u src/tests/lib/libc/gen/t_humanize_number.c:1.9 src/tests/lib/libc/gen/t_humanize_number.c:1.10
--- src/tests/lib/libc/gen/t_humanize_number.c:1.9 Tue Jan 10 15:20:44 2017
+++ src/tests/lib/libc/gen/t_humanize_number.c Mon Mar 11 17:45:12 2019
@@ -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_TC_BODY(humanize_number_big, tc)
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.