summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorsisyphus <sisyphus@cpan.org>2020-10-21 10:52:11 +1100
committerKarl Williamson <khw@cpan.org>2020-12-27 12:09:06 -0700
commitcfc95b5630c63927ab68bb4cdc08b1dec23c5569 (patch)
tree13269904c0493963de80c60cfbd6a1a573087ce9 /Configure
parentec8faddea92f3f0c23233b57a34f11b94391762f (diff)
downloadperl-cfc95b5630c63927ab68bb4cdc08b1dec23c5569.tar.gz
Configure - test that gcvt/qgcvt are not buggy (Issue 18170)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/Configure b/Configure
index 90ea4bd552..2d2f22fc08 100755
--- a/Configure
+++ b/Configure
@@ -10374,6 +10374,15 @@ void checkit(const char *expect, char *got)
}
}
+void lencheck(int expect, int got)
+{
+ if (expect != got) {
+ printf("%s length mismatch: Expected %d, got %d\n",
+ myname, expect, got);
+ exit(1);
+ }
+}
+
int main()
{
char buf[64];
@@ -10446,6 +10455,12 @@ int main()
else
checkit("1e+34", buf);
+ /* Test for an Ubuntu/Debian bug in gcvt and qgcvt. See: *
+ * https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1899553 */
+
+ Gconvert((DOUBLETYPE)0.4, 53, 0, buf);
+ lencheck(55, (int)strlen(buf));
+
/* For Perl, if you add additional tests here, also add them to
* t/base/num.t for benefit of platforms not using Configure or
* overriding d_Gconvert */