also use MP_YES/NO in tests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/demo/test.c b/demo/test.c
index bfe934b..0f0152a 100644
--- a/demo/test.c
+++ b/demo/test.c
@@ -1061,7 +1061,7 @@ static int test_mp_prime_next_prime(void)
/* edge cases */
mp_set(&a, 0u);
- if ((err = mp_prime_next_prime(&a, 5, 0)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_NO)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp_d(&a, 2u) != MP_EQ) {
@@ -1072,7 +1072,7 @@ static int test_mp_prime_next_prime(void)
}
mp_set(&a, 0u);
- if ((err = mp_prime_next_prime(&a, 5, 1)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_YES)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp_d(&a, 3u) != MP_EQ) {
@@ -1083,7 +1083,7 @@ static int test_mp_prime_next_prime(void)
}
mp_set(&a, 2u);
- if ((err = mp_prime_next_prime(&a, 5, 0)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_NO)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp_d(&a, 3u) != MP_EQ) {
@@ -1094,7 +1094,7 @@ static int test_mp_prime_next_prime(void)
}
mp_set(&a, 2u);
- if ((err = mp_prime_next_prime(&a, 5, 1)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_YES)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp_d(&a, 3u) != MP_EQ) {
@@ -1104,7 +1104,7 @@ static int test_mp_prime_next_prime(void)
goto LBL_ERR;
}
mp_set(&a, 8);
- if ((err = mp_prime_next_prime(&a, 5, 1)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_YES)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp_d(&a, 11u) != MP_EQ) {
@@ -1130,7 +1130,7 @@ static int test_mp_prime_next_prime(void)
if ((err = mp_add(&b, &c, &b)) != MP_OKAY) {
goto LBL_ERR;
}
- if ((err = mp_prime_next_prime(&a, 5, 0)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_NO)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp(&a, &b) != MP_EQ) {
@@ -1160,7 +1160,7 @@ static int test_mp_prime_next_prime(void)
if ((err = mp_add(&b, &c, &b)) != MP_OKAY) {
goto LBL_ERR;
}
- if ((err = mp_prime_next_prime(&a, 5, 1)) != MP_OKAY) {
+ if ((err = mp_prime_next_prime(&a, 5, MP_YES)) != MP_OKAY) {
goto LBL_ERR;
}
if (mp_cmp(&a, &b) != MP_EQ) {
@@ -1284,7 +1284,7 @@ static int test_mp_read_radix(void)
char *s = fgets(buf, sizeof(buf), stdin);
if (s != buf) break;
mp_read_radix(&a, buf, 10);
- mp_prime_next_prime(&a, 5, 1);
+ mp_prime_next_prime(&a, 5, MP_YES);
mp_to_radix(&a, buf, sizeof(buf), NULL, 10);
printf("%s, %lu\n", buf, (unsigned long)a.dp[0] & 3uL);
}