From aef147f3605150b0072cb9a5e23c30fd2f0b5fff Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Fri, 6 Sep 2024 21:25:05 -0500 Subject: [PATCH] fix test on non-linux platforms --- cplusplus/src/tests/test_is_prime.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cplusplus/src/tests/test_is_prime.cpp b/cplusplus/src/tests/test_is_prime.cpp index eaa8fa62..cc923b52 100644 --- a/cplusplus/src/tests/test_is_prime.cpp +++ b/cplusplus/src/tests/test_is_prime.cpp @@ -1,4 +1,5 @@ #include +#include #include "../include/primes.hpp" #ifndef MAX_PRIME @@ -7,9 +8,8 @@ int main(int argc, char const *argv[]) { // prints number, is_prime(), is_composite(), prime index or -1 - PrimeGenerator pc = primes_until(MAX_PRIME); - uintmax_t i, p, prev = 0, count = 0; - p = pc.next(); + PrimeGenerator pc = primes_until(MAX_PRIME); + uint64_t i, prev = 0, count = 0, p = pc.next(); while (p < MAX_PRIME && pc.has_next()) { for (i = prev + 1; i < p; i++) std::cout << i << " " << is_prime(i) << " " << is_composite(i) << " -1" << std::endl;