Commit 3180c66ca6da9ad275d06e5985af1ce47229ea2e

Steffen Jaeckel 2019-10-23T18:17:20

also use MP_YES/NO in tests

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);
    }