diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2012-12-15 16:24:08 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2012-12-15 16:24:08 +0100 |
commit | c03777f4a88229701a0b7209cd1aafe18a8e6a87 (patch) | |
tree | 45be07d731b04057475b2abdf3a1e719f58628b5 /tests | |
parent | 44966dc6afa7d1552765452237150ea13529d3a7 (diff) | |
download | gmp-c03777f4a88229701a0b7209cd1aafe18a8e6a87.tar.gz |
Indent.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mpn/toom-sqr-shared.h | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/tests/mpn/toom-sqr-shared.h b/tests/mpn/toom-sqr-shared.h index 2de628e8c..f08838fd1 100644 --- a/tests/mpn/toom-sqr-shared.h +++ b/tests/mpn/toom-sqr-shared.h @@ -56,72 +56,72 @@ main (int argc, char **argv) tests_start (); if (MAX_AN > MIN_AN) { - rands = RANDS; - - ap = TMP_ALLOC_LIMBS (MAX_AN); - refp = TMP_ALLOC_LIMBS (MAX_AN * 2); - pp = 1 + TMP_ALLOC_LIMBS (MAX_AN * 2 + 2); - scratch - = 1+TMP_ALLOC_LIMBS (mpn_toomN_sqr_itch (MAX_AN) + 2); - - for (test = 0; test < count; test++) - { - unsigned size_min; - unsigned size_range; - mp_size_t an; - mp_size_t itch; - mp_limb_t p_before, p_after, s_before, s_after; - - an = MIN_AN - + gmp_urandomm_ui (rands, MAX_AN - MIN_AN); - - mpn_random2 (ap, an); - mpn_random2 (pp-1, an * 2 + 2); - p_before = pp[-1]; - p_after = pp[an * 2]; - - itch = mpn_toomN_sqr_itch (an); - ASSERT_ALWAYS (itch <= mpn_toomN_sqr_itch (MAX_AN)); - mpn_random2 (scratch-1, itch+2); - s_before = scratch[-1]; - s_after = scratch[itch]; - - mpn_toomN_sqr (pp, ap, an, scratch); - refmpn_mul (refp, ap, an, ap, an); - if (pp[-1] != p_before || pp[an * 2] != p_after - || scratch[-1] != s_before || scratch[itch] != s_after - || mpn_cmp (refp, pp, an * 2) != 0) - { - printf ("ERROR in test %d, an = %d\n", - test, (int) an); - if (pp[-1] != p_before) - { - printf ("before pp:"); mpn_dump (pp -1, 1); - printf ("keep: "); mpn_dump (&p_before, 1); - } - if (pp[an * 2] != p_after) - { - printf ("after pp:"); mpn_dump (pp + an * 2, 1); - printf ("keep: "); mpn_dump (&p_after, 1); - } - if (scratch[-1] != s_before) - { - printf ("before scratch:"); mpn_dump (scratch-1, 1); - printf ("keep: "); mpn_dump (&s_before, 1); - } - if (scratch[itch] != s_after) - { - printf ("after scratch:"); mpn_dump (scratch + itch, 1); - printf ("keep: "); mpn_dump (&s_after, 1); - } - mpn_dump (ap, an); - mpn_dump (pp, an * 2); - mpn_dump (refp, an * 2); - - abort(); - } - } - TMP_FREE; + rands = RANDS; + + ap = TMP_ALLOC_LIMBS (MAX_AN); + refp = TMP_ALLOC_LIMBS (MAX_AN * 2); + pp = 1 + TMP_ALLOC_LIMBS (MAX_AN * 2 + 2); + scratch + = 1+TMP_ALLOC_LIMBS (mpn_toomN_sqr_itch (MAX_AN) + 2); + + for (test = 0; test < count; test++) + { + unsigned size_min; + unsigned size_range; + mp_size_t an; + mp_size_t itch; + mp_limb_t p_before, p_after, s_before, s_after; + + an = MIN_AN + + gmp_urandomm_ui (rands, MAX_AN - MIN_AN); + + mpn_random2 (ap, an); + mpn_random2 (pp-1, an * 2 + 2); + p_before = pp[-1]; + p_after = pp[an * 2]; + + itch = mpn_toomN_sqr_itch (an); + ASSERT_ALWAYS (itch <= mpn_toomN_sqr_itch (MAX_AN)); + mpn_random2 (scratch-1, itch+2); + s_before = scratch[-1]; + s_after = scratch[itch]; + + mpn_toomN_sqr (pp, ap, an, scratch); + refmpn_mul (refp, ap, an, ap, an); + if (pp[-1] != p_before || pp[an * 2] != p_after + || scratch[-1] != s_before || scratch[itch] != s_after + || mpn_cmp (refp, pp, an * 2) != 0) + { + printf ("ERROR in test %d, an = %d\n", + test, (int) an); + if (pp[-1] != p_before) + { + printf ("before pp:"); mpn_dump (pp -1, 1); + printf ("keep: "); mpn_dump (&p_before, 1); + } + if (pp[an * 2] != p_after) + { + printf ("after pp:"); mpn_dump (pp + an * 2, 1); + printf ("keep: "); mpn_dump (&p_after, 1); + } + if (scratch[-1] != s_before) + { + printf ("before scratch:"); mpn_dump (scratch-1, 1); + printf ("keep: "); mpn_dump (&s_before, 1); + } + if (scratch[itch] != s_after) + { + printf ("after scratch:"); mpn_dump (scratch + itch, 1); + printf ("keep: "); mpn_dump (&s_after, 1); + } + mpn_dump (ap, an); + mpn_dump (pp, an * 2); + mpn_dump (refp, an * 2); + + abort(); + } + } + TMP_FREE; } tests_end (); |