summaryrefslogtreecommitdiff
path: root/tests/tget_str.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-10-30 14:26:03 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-10-30 14:26:03 +0000
commit0c98c821608efdd9a9014e0e9de744e215fdce31 (patch)
treed33570f4a628d0ab29302aa9f71223af74c0b625 /tests/tget_str.c
parentbcaad054cf42051f9101e6f7a9fa2d88f1d1b819 (diff)
downloadmpfr-0c98c821608efdd9a9014e0e9de744e215fdce31.tar.gz
[tests/tget_str.c] Fixed a test that made mpfr_get_str crash with
logging (even when the base is invalid, the MPFR number must be initialized). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9224 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_str.c')
-rw-r--r--tests/tget_str.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/tget_str.c b/tests/tget_str.c
index 97d69320c..10ab25796 100644
--- a/tests/tget_str.c
+++ b/tests/tget_str.c
@@ -1085,6 +1085,8 @@ check_special (int b, mpfr_prec_t p)
int r;
size_t m;
+ mpfr_init2 (x, p);
+
/* check for invalid base */
if (mpfr_get_str (s, &e, 1, 10, x, MPFR_RNDN) != NULL)
{
@@ -1101,7 +1103,6 @@ check_special (int b, mpfr_prec_t p)
for (i=1; i<MAX_DIGITS+2; i++)
s2[i] = '0';
- mpfr_init2 (x, p);
mpfr_set_ui (x, 1, MPFR_RNDN);
for (i=1; i<MAX_DIGITS && mpfr_mul_ui (x, x, b, MPFR_RNDN) == 0; i++)
{