1 | |
2 | void test_mpz_export(char **out, char *rop, size_t *countp, int order, |
3 | size_t size, int endian, size_t nails, char *mpzstr) { |
4 | impz_t op; |
5 | impz_init(op); |
6 | impz_set_str(op, mpzstr, 10); |
7 | // printf("%p,%p,%d,%zi,%d,%zi,%s\n", rop, countp, order, size, endian, nails, |
8 | // mpzstr); |
9 | *out = impz_export(rop, countp, order, size, endian, nails, op); |
10 | } |
11 | |
12 | void test_mpz_import(char *out, void *unused, size_t count, int order, |
13 | size_t size, int endian, size_t nails, char *mpzstr) { |
14 | impz_t op; |
15 | impz_t rop; |
16 | impz_init(op); |
17 | impz_init(rop); |
18 | impz_set_str(op, mpzstr, 10); |
19 | char *data; |
20 | |
21 | // printf("%p,%p,%d,%zi,%d,%zi,%s\n", rop, countp, order, size, endian, nails, |
22 | // mpzstr); |
23 | data = impz_export(NULL, &count, order, size, endian, nails, op); |
24 | impz_import(rop, count, order, size, endian, nails, data); |
25 | int eq = impz_cmpabs(op, rop); |
26 | sprintf(out, "%2d:" , eq); |
27 | impz_get_str(out + 3, 10, rop); |
28 | } |
29 | |