summaryrefslogtreecommitdiff
path: root/tests/tsub1sp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tsub1sp.c')
-rw-r--r--tests/tsub1sp.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/tests/tsub1sp.c b/tests/tsub1sp.c
index 5fbb91d43..8a5c1dee5 100644
--- a/tests/tsub1sp.c
+++ b/tests/tsub1sp.c
@@ -43,29 +43,33 @@ main (void)
return 0;
}
-#define STD_ERROR \
- {\
- printf("ERROR: for %s and p=%lu and i=%d:\nY=",\
- mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\
- mpfr_print_binary(y);\
- printf("\nZ="); mpfr_print_binary(z);\
- printf("\nReal: "); mpfr_print_binary(x2);\
- printf("\nGot : "); mpfr_print_binary(x);\
- putchar('\n');\
- exit(1);\
- }
-
-#define STD_ERROR2 \
- {\
- printf("ERROR: for %s and p=%lu and i=%d:\nY=",\
- mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\
- mpfr_print_binary(y);\
- printf("\nZ="); mpfr_print_binary(z);\
- printf("\nR="); mpfr_print_binary(x);\
- printf("\nWrong inexact flag. Real: %d. Got: %d\n", \
- inexact1, inexact2); \
- exit(1);\
- }
+#define STD_ERROR \
+ do \
+ { \
+ printf("ERROR: for %s and p=%lu and i=%d:\nY=", \
+ mpfr_print_rnd_mode ((mpfr_rnd_t) r), (unsigned long) p, i); \
+ mpfr_print_binary(y); \
+ printf("\nZ="); mpfr_print_binary(z); \
+ printf("\nReal: "); mpfr_print_binary(x2); \
+ printf("\nGot : "); mpfr_print_binary(x); \
+ putchar('\n'); \
+ exit(1); \
+ } \
+ while (0)
+
+#define STD_ERROR2 \
+ do \
+ { \
+ printf("ERROR: for %s and p=%lu and i=%d:\nY=", \
+ mpfr_print_rnd_mode ((mpfr_rnd_t) r), (unsigned long) p, i); \
+ mpfr_print_binary(y); \
+ printf("\nZ="); mpfr_print_binary(z); \
+ printf("\nR="); mpfr_print_binary(x); \
+ printf("\nWrong inexact flag. Real: %d. Got: %d\n", \
+ inexact1, inexact2); \
+ exit(1); \
+ } \
+ while (0)
static void
check_random (mpfr_prec_t p)
@@ -120,7 +124,8 @@ check_special (void)
mpfr_sub1sp (x, y, y, (mpfr_rnd_t) r);
if (mpfr_cmp_ui(x, 0))
{
- printf("Error for x-x with p=%lu. Expected 0. Got:", p);
+ printf("Error for x-x with p=%lu. Expected 0. Got:",
+ (unsigned long) p);
mpfr_print_binary(x);
exit(1);
}
@@ -129,7 +134,8 @@ check_special (void)
mpfr_sub1sp(x, y, z, (mpfr_rnd_t) r);
if (mpfr_cmp_ui(x, 0))
{
- printf("Error for x-y with y=x and p=%lu. Expected 0. Got:", p);
+ printf("Error for x-y with y=x and p=%lu. Expected 0. Got:",
+ (unsigned long) p);
mpfr_print_binary(x);
exit(1);
}