Lines Matching full:in
10 in the Software without restriction, including without limitation the rights
15 The above copyright notice and this permission notice shall be included in
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
73 /* Read in a string with radix tags */
77 /* Read in a string with radix tags, as a long (not an mp_int) */
80 /* Parse the input and output values and fill in pointers to the
82 in case of error. Caller allocates in/out to correct sizes. */
83 static bool parse_int_values(testspec_t* t, mp_int* in, mp_int* out,
85 static bool parse_rat_values(testspec_t* t, mp_rat* in, mp_rat* out,
91 /* Read in a dot-delimited binary sequence to the given buffer, and return the
92 number of bytes read. Returns < 0 in case of a syntax error. Records no
201 static bool parse_int_values(testspec_t* t, mp_int* in, mp_int* out, in parse_int_values() argument
208 if (in != NULL) { in parse_int_values()
223 in[i] = in[k]; in parse_int_values()
232 in[i] = reg; in parse_int_values()
272 static bool parse_rat_values(testspec_t* t, mp_rat* in, mp_rat* out, in parse_rat_values() argument
279 if (in != NULL) { in parse_rat_values()
294 in[i] = in[k]; in parse_rat_values()
303 in[i] = reg; in parse_rat_values()
435 mp_int in[2], out[1]; in test_init() local
440 ACHECK(parse_int_values(t, in, out, &expect)); in test_init()
443 CHECK(mp_int_to_uint(in[1], &uv)); in test_init()
444 ECHECK(mp_int_init_uvalue(in[0], uv)); in test_init()
446 CHECK(mp_int_to_int(in[1], &v)); in test_init()
447 ECHECK(mp_int_init_value(in[0], v)); in test_init()
450 if (expect == MP_OK && mp_int_compare(in[0], out[0]) != 0) { in test_init()
451 mp_int_to_string(in[0], 10, g_output, OUTPUT_LIMIT); in test_init()
459 mp_int in[2], out[1]; in test_set() local
464 ACHECK(parse_int_values(t, in, out, &expect)); in test_set()
467 CHECK(mp_int_to_uint(in[1], &uv)); in test_set()
468 ECHECK(mp_int_set_uvalue(in[0], uv)); in test_set()
470 CHECK(mp_int_to_int(in[1], &v)); in test_set()
471 ECHECK(mp_int_set_value(in[0], v)); in test_set()
474 if (expect == MP_OK && mp_int_compare(in[0], out[0]) != 0) { in test_set()
475 mp_int_to_string(in[0], 10, g_output, OUTPUT_LIMIT); in test_set()
483 mp_int in[2], out[1]; in test_neg() local
486 ACHECK(parse_int_values(t, in, out, &expect)); in test_neg()
487 ECHECK(mp_int_neg(in[0], in[1])); in test_neg()
489 if (expect == MP_OK && mp_int_compare(in[1], out[0]) != 0) { in test_neg()
490 mp_int_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_neg()
498 mp_int in[2], out[1]; in test_abs() local
501 ACHECK(parse_int_values(t, in, out, &expect)); in test_abs()
502 ECHECK(mp_int_abs(in[0], in[1])); in test_abs()
504 if (expect == MP_OK && mp_int_compare(in[1], out[0]) != 0) { in test_abs()
505 mp_int_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_abs()
513 mp_int in[3], out[1]; in test_add() local
517 ACHECK(parse_int_values(t, in, out, &expect)); in test_add()
520 CHECK(mp_int_to_int(in[1], &v)); in test_add()
521 ECHECK(mp_int_add_value(in[0], v, in[2])); in test_add()
523 ECHECK(mp_int_add(in[0], in[1], in[2])); in test_add()
526 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_add()
527 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_add()
535 mp_int in[3], out[1]; in test_sub() local
539 ACHECK(parse_int_values(t, in, out, &expect)); in test_sub()
542 CHECK(mp_int_to_int(in[1], &v)); in test_sub()
543 ECHECK(mp_int_sub_value(in[0], v, in[2])); in test_sub()
545 ECHECK(mp_int_sub(in[0], in[1], in[2])); in test_sub()
548 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_sub()
549 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_sub()
556 mp_int in[3], out[1]; in test_mul() local
559 ACHECK(parse_int_values(t, in, out, &expect)); in test_mul()
560 ECHECK(mp_int_mul(in[0], in[1], in[2])); in test_mul()
562 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_mul()
563 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_mul()
570 mp_int in[3], out[1]; in test_mulp2() local
574 ACHECK(parse_int_values(t, in, out, &expect)); in test_mulp2()
575 CHECK(mp_int_to_int(in[1], &p2)); in test_mulp2()
576 ECHECK(mp_int_mul_pow2(in[0], p2, in[2])); in test_mulp2()
578 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_mulp2()
579 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_mulp2()
586 mp_int in[3], out[1]; in test_mulv() local
590 ACHECK(parse_int_values(t, in, out, &expect)); in test_mulv()
591 CHECK(mp_int_to_int(in[1], &v)); in test_mulv()
592 ECHECK(mp_int_mul_value(in[0], v, in[2])); in test_mulv()
594 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_mulv()
595 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_mulv()
602 mp_int in[2], out[1]; in test_sqr() local
605 ACHECK(parse_int_values(t, in, out, &expect)); in test_sqr()
606 ECHECK(mp_int_sqr(in[0], in[1])); in test_sqr()
608 if (expect == MP_OK && mp_int_compare(in[1], out[0]) != 0) { in test_sqr()
609 mp_int_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_sqr()
616 mp_int in[4], out[2]; in test_div() local
619 ACHECK(parse_int_values(t, in, out, &expect)); in test_div()
620 ECHECK(mp_int_div(in[0], in[1], in[2], in[3])); in test_div()
622 if (expect == MP_OK && ((mp_int_compare(in[2], out[0]) != 0) || in test_div()
623 (mp_int_compare(in[3], out[1]) != 0))) { in test_div()
627 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_div()
630 mp_int_to_string(in[3], 10, str, OUTPUT_LIMIT - (len + 1)); in test_div()
637 mp_int in[4], out[2]; in test_divp2() local
641 ACHECK(parse_int_values(t, in, out, &expect)); in test_divp2()
642 CHECK(mp_int_to_int(in[1], &p2)); in test_divp2()
643 ECHECK(mp_int_div_pow2(in[0], p2, in[2], in[3])); in test_divp2()
645 if (expect == MP_OK && ((mp_int_compare(in[2], out[0]) != 0) || in test_divp2()
646 (mp_int_compare(in[3], out[1]) != 0))) { in test_divp2()
650 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_divp2()
653 mp_int_to_string(in[3], 10, str, OUTPUT_LIMIT - (len + 1)); in test_divp2()
660 mp_int in[3], out[2]; in test_divv() local
664 ACHECK(parse_int_values(t, in, out, &expect)); in test_divv()
665 CHECK(mp_int_to_int(in[1], &v)); in test_divv()
667 ECHECK(mp_int_div_value(in[0], v, in[2], &rem)); in test_divv()
670 ((mp_int_compare(in[2], out[0]) != 0) || (rem != orem))) { in test_divv()
673 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_divv()
683 mp_int in[3], out[1]; in test_expt() local
687 ACHECK(parse_int_values(t, in, out, &expect)); in test_expt()
688 CHECK(mp_int_to_int(in[1], &pow)); in test_expt()
689 ECHECK(mp_int_expt(in[0], pow, in[2])); in test_expt()
691 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_expt()
692 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_expt()
699 mp_int in[3], out[1]; in test_exptv() local
703 ACHECK(parse_int_values(t, in, out, &expect)); in test_exptv()
704 CHECK(mp_int_to_int(in[0], &a)); in test_exptv()
705 CHECK(mp_int_to_int(in[1], &b)); in test_exptv()
706 ECHECK(mp_int_expt_value(a, b, in[2])); in test_exptv()
708 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_exptv()
709 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_exptv()
716 mp_int in[3], out[1]; in test_exptf() local
719 ACHECK(parse_int_values(t, in, out, &expect)); in test_exptf()
720 ECHECK(mp_int_expt_full(in[0], in[1], in[2])); in test_exptf()
722 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_exptf()
723 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_exptf()
730 mp_int in[3], out[1]; in test_mod() local
733 ACHECK(parse_int_values(t, in, out, &expect)); in test_mod()
734 ECHECK(mp_int_mod(in[0], in[1], in[2])); in test_mod()
736 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_mod()
737 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_mod()
744 mp_int in[3], out[1]; in test_gcd() local
747 ACHECK(parse_int_values(t, in, out, &expect)); in test_gcd()
748 ECHECK(mp_int_gcd(in[0], in[1], in[2])); in test_gcd()
750 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_gcd()
751 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_gcd()
758 mp_int in[5], out[3], t1 = g_zreg + 8, t2 = g_zreg + 9; in test_egcd() local
761 ACHECK(parse_int_values(t, in, out, &expect)); in test_egcd()
762 ECHECK(mp_int_egcd(in[0], in[1], in[2], in[3], in[4])); in test_egcd()
767 if ((mp_int_compare(in[2], out[0]) != 0) || in test_egcd()
768 (mp_int_compare(in[3], out[1]) != 0) || in test_egcd()
769 (mp_int_compare(in[4], out[2]) != 0)) { in test_egcd()
773 /* Failure might occur because the tester computed x and y in a different in test_egcd()
776 mp_int_mul(in[3], in[0], t1); in test_egcd()
777 mp_int_mul(in[4], in[1], t2); in test_egcd()
779 if (mp_int_compare(t2, in[2]) == 0) return true; in test_egcd()
781 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_egcd()
784 mp_int_to_string(in[3], 10, str, OUTPUT_LIMIT - (len + 1)); in test_egcd()
787 mp_int_to_string(in[4], 10, str, OUTPUT_LIMIT - (len + len2 + 2)); in test_egcd()
794 mp_int in[3], out[1]; in test_lcm() local
797 ACHECK(parse_int_values(t, in, out, &expect)); in test_lcm()
798 ECHECK(mp_int_lcm(in[0], in[1], in[2])); in test_lcm()
800 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_lcm()
801 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_lcm()
808 mp_int in[2], out[1]; in test_sqrt() local
811 ACHECK(parse_int_values(t, in, out, &expect)); in test_sqrt()
812 ECHECK(mp_int_sqrt(in[0], in[1])); in test_sqrt()
814 if (expect == MP_OK && mp_int_compare(in[1], out[0]) != 0) { in test_sqrt()
815 mp_int_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_sqrt()
822 mp_int in[3], out[1]; in test_root() local
826 ACHECK(parse_int_values(t, in, out, &expect)); in test_root()
827 CHECK(mp_int_to_int(in[1], &v)); in test_root()
828 ECHECK(mp_int_root(in[0], v, in[2])); in test_root()
830 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_root()
831 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_root()
838 mp_int in[3], out[1]; in test_invmod() local
841 ACHECK(parse_int_values(t, in, out, &expect)); in test_invmod()
842 ECHECK(mp_int_invmod(in[0], in[1], in[2])); in test_invmod()
844 if (expect == MP_OK && mp_int_compare(in[2], out[0]) != 0) { in test_invmod()
845 mp_int_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_invmod()
852 mp_int in[4], out[1]; in test_exptmod() local
855 ACHECK(parse_int_values(t, in, out, &expect)); in test_exptmod()
856 ECHECK(mp_int_exptmod(in[0], in[1], in[2], in[3])); in test_exptmod()
858 if (expect == MP_OK && mp_int_compare(in[3], out[0]) != 0) { in test_exptmod()
859 mp_int_to_string(in[3], 10, g_output, OUTPUT_LIMIT); in test_exptmod()
866 mp_int in[4], out[1]; in test_exptmod_ev() local
870 ACHECK(parse_int_values(t, in, out, &expect)); in test_exptmod_ev()
871 CHECK(mp_int_to_int(in[1], &v)); in test_exptmod_ev()
872 ECHECK(mp_int_exptmod_evalue(in[0], v, in[2], in[3])); in test_exptmod_ev()
874 if (expect == MP_OK && mp_int_compare(in[3], out[0]) != 0) { in test_exptmod_ev()
875 mp_int_to_string(in[3], 10, g_output, OUTPUT_LIMIT); in test_exptmod_ev()
882 mp_int in[4], out[1]; in test_exptmod_bv() local
886 ACHECK(parse_int_values(t, in, out, &expect)); in test_exptmod_bv()
887 CHECK(mp_int_to_int(in[0], &v)); in test_exptmod_bv()
888 ECHECK(mp_int_exptmod_bvalue(v, in[1], in[2], in[3])); in test_exptmod_bv()
890 if (expect == MP_OK && mp_int_compare(in[3], out[0]) != 0) { in test_exptmod_bv()
891 mp_int_to_string(in[3], 10, g_output, OUTPUT_LIMIT); in test_exptmod_bv()
898 mp_int in[2]; in test_comp() local
901 ACHECK(parse_int_values(t, in, NULL, &expect)); in test_comp()
903 if ((res = mp_int_compare(in[0], in[1])) != expect) { in test_comp()
912 mp_int in[2]; in test_ucomp() local
915 ACHECK(parse_int_values(t, in, NULL, &expect)); in test_ucomp()
917 if ((res = mp_int_compare_unsigned(in[0], in[1])) != expect) { in test_ucomp()
926 mp_int in[1]; in test_zcomp() local
929 ACHECK(parse_int_values(t, in, NULL, &expect)); in test_zcomp()
931 if ((res = mp_int_compare_zero(in[0])) != expect) { in test_zcomp()
940 mp_int in[2]; in test_vcomp() local
944 ACHECK(parse_int_values(t, in, NULL, &expect)); in test_vcomp()
947 if ((res = mp_int_compare_value(in[0], v)) != expect) { in test_vcomp()
956 mp_int in[2]; in test_uvcomp() local
960 ACHECK(parse_int_values(t, in, NULL, &expect)); in test_uvcomp()
963 if ((res = mp_int_compare_uvalue(in[0], v)) != expect) { in test_uvcomp()
972 mp_int in[2]; in test_tostr() local
976 ACHECK(parse_int_values(t, in, NULL, NULL)); in test_tostr()
977 ACHECK(mp_int_to_int(in[1], &radix) == MP_OK); in test_tostr()
982 len = mp_int_string_len(in[0], radix); in test_tostr()
984 CHECK(mp_int_to_string(in[0], radix, g_output, len)); in test_tostr()
992 mp_int in[1]; in test_tobin() local
995 ACHECK(parse_int_values(t, in, NULL, NULL)); in test_tobin()
1001 if ((test_len = mp_int_binary_len(in[0])) != out_len) { in test_tobin()
1007 CHECK(mp_int_to_binary(in[0], g_bin2, sizeof(g_bin2))); in test_tobin()
1022 mp_int in[1], out[1]; in test_to_int() local
1026 ACHECK(parse_int_values(t, in, out, &expect)); in test_to_int()
1027 ECHECK(mp_int_to_int(in[0], &v)); in test_to_int()
1037 mp_int in[1], out[1]; in test_to_uint() local
1041 ACHECK(parse_int_values(t, in, out, &expect)); in test_to_uint()
1042 ECHECK(mp_int_to_uint(in[0], &v)); in test_to_uint()
1052 mp_int out[1], in = g_zreg + 1; in test_read_binary() local
1062 ECHECK(mp_int_read_binary(in, g_bin1, in_len)); in test_read_binary()
1064 if (expect == MP_OK && mp_int_compare(in, out[0]) != 0) { in test_read_binary()
1065 mp_int_to_string(in, 10, g_output, OUTPUT_LIMIT); in test_read_binary()
1072 mp_int in[1]; in test_to_uns() local
1075 ACHECK(parse_int_values(t, in, NULL, NULL)); in test_to_uns()
1081 if ((test_len = mp_int_unsigned_len(in[0])) != out_len) { in test_to_uns()
1087 CHECK(mp_int_to_unsigned(in[0], g_bin2, sizeof(g_bin2))); in test_to_uns()
1102 mp_int out[1], in = g_zreg + 1; in test_read_uns() local
1112 ECHECK(mp_int_read_unsigned(in, g_bin1, in_len)); in test_read_uns()
1114 if (expect == MP_OK && mp_int_compare(in, out[0]) != 0) { in test_read_uns()
1115 mp_int_to_string(in, 10, g_output, OUTPUT_LIMIT); in test_read_uns()
1122 mp_int *in = NULL, *out = NULL; in test_meta() local
1127 in = calloc(t->num_inputs, sizeof(mp_int)); in test_meta()
1133 if (!parse_int_values(t, in, out, &expect)) { in test_meta()
1134 if (in != NULL) free(in); in test_meta()
1143 mp_int_to_string(in[i], 10, g_output, OUTPUT_LIMIT); in test_meta()
1148 if (in[j] == in[i]) { in test_meta()
1161 if (in != NULL) free(in); in test_meta()
1167 mp_rat in[2], out[1]; in test_qneg() local
1170 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qneg()
1171 ECHECK(mp_rat_neg(in[0], in[1])); in test_qneg()
1173 if (expect == MP_OK && mp_rat_compare(in[1], out[0]) != 0) { in test_qneg()
1174 mp_rat_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_qneg()
1181 mp_rat in[2], out[1]; in test_qrecip() local
1184 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qrecip()
1185 ECHECK(mp_rat_recip(in[0], in[1])); in test_qrecip()
1187 if (expect == MP_OK && mp_rat_compare(in[1], out[0]) != 0) { in test_qrecip()
1188 mp_rat_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_qrecip()
1195 mp_rat in[2], out[1]; in test_qabs() local
1198 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qabs()
1199 ECHECK(mp_rat_abs(in[0], in[1])); in test_qabs()
1201 if (expect == MP_OK && mp_rat_compare(in[1], out[0]) != 0) { in test_qabs()
1202 mp_rat_to_string(in[1], 10, g_output, OUTPUT_LIMIT); in test_qabs()
1209 mp_rat in[3], out[1]; in test_qadd() local
1212 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qadd()
1213 ECHECK(mp_rat_add(in[0], in[1], in[2])); in test_qadd()
1215 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qadd()
1216 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qadd()
1223 mp_rat in[3], out[1]; in test_qsub() local
1226 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qsub()
1227 ECHECK(mp_rat_sub(in[0], in[1], in[2])); in test_qsub()
1229 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qsub()
1230 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qsub()
1237 mp_rat in[3], out[1]; in test_qmul() local
1240 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qmul()
1241 ECHECK(mp_rat_mul(in[0], in[1], in[2])); in test_qmul()
1243 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qmul()
1244 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qmul()
1251 mp_rat in[3], out[1]; in test_qdiv() local
1254 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qdiv()
1255 ECHECK(mp_rat_div(in[0], in[1], in[2])); in test_qdiv()
1257 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qdiv()
1258 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qdiv()
1265 mp_rat in[3], out[1]; in test_qaddz() local
1268 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qaddz()
1270 if (!mp_rat_is_integer(in[1])) { in test_qaddz()
1277 ECHECK(mp_rat_add_int(in[0], MP_NUMER_P(in[1]), in[2])); in test_qaddz()
1279 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qaddz()
1280 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qaddz()
1287 mp_rat in[3], out[1]; in test_qsubz() local
1290 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qsubz()
1292 if (!mp_rat_is_integer(in[1])) { in test_qsubz()
1299 ECHECK(mp_rat_sub_int(in[0], MP_NUMER_P(in[1]), in[2])); in test_qsubz()
1301 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qsubz()
1302 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qsubz()
1309 mp_rat in[3], out[1]; in test_qmulz() local
1312 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qmulz()
1314 if (!mp_rat_is_integer(in[1])) { in test_qmulz()
1321 ECHECK(mp_rat_mul_int(in[0], MP_NUMER_P(in[1]), in[2])); in test_qmulz()
1323 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qmulz()
1324 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qmulz()
1331 mp_rat in[3], out[1]; in test_qdivz() local
1334 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qdivz()
1336 if (!mp_rat_is_integer(in[1])) { in test_qdivz()
1343 ECHECK(mp_rat_div_int(in[0], MP_NUMER_P(in[1]), in[2])); in test_qdivz()
1345 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qdivz()
1346 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qdivz()
1353 mp_rat in[3], out[1]; in test_qexpt() local
1357 ACHECK(parse_rat_values(t, in, out, &expect)); in test_qexpt()
1359 if (!mp_rat_is_integer(in[1])) { in test_qexpt()
1366 CHECK(mp_int_to_int(MP_NUMER_P(in[1]), &power)); in test_qexpt()
1367 ECHECK(mp_rat_expt(in[0], power, in[2])); in test_qexpt()
1369 if (expect == MP_OK && mp_rat_compare(in[2], out[0]) != 0) { in test_qexpt()
1370 mp_rat_to_string(in[2], 10, g_output, OUTPUT_LIMIT); in test_qexpt()
1377 mp_rat in[2]; in test_qtostr() local
1381 ACHECK(parse_rat_values(t, in, NULL, NULL)); in test_qtostr()
1391 len = mp_rat_string_len(in[0], radix); in test_qtostr()
1393 CHECK(mp_rat_to_string(in[0], radix, g_output, len)); in test_qtostr()
1401 mp_rat in[4]; in test_qtodec() local
1406 ACHECK(parse_rat_values(t, in, NULL, NULL)); in test_qtodec()
1428 len = mp_rat_decimal_len(in[0], radix, prec); in test_qtodec()
1429 ECHECK((res = mp_rat_to_decimal(in[0], radix, prec, rmode, g_output, len))); in test_qtodec()
1454 mp_int in[1] = {NULL}; in test_is_prime() local
1457 ACHECK(parse_int_values(t, in, NULL, &expect)); in test_is_prime()
1458 ECHECK(mp_int_is_prime(in[0])); in test_is_prime()