Test_sieve.c - about max_primes function parameter

hi, i want to ask about this

static void test_limit_is_prime_and_small_max_primes(void)
{
   const uint32_t limit = 13;
   const uint32_t expected_prime_array[] = { 2, 3, 5, 7, 11, 13 };
   const uint32_t expected_prime_count = 4;

   const uint32_t result_prime_count = sieve(limit, result_array, 4);

   TEST_ASSERT_EQUAL(expected_prime_count, result_prime_count);
   TEST_ASSERT_EQUAL_UINT_ARRAY(expected_prime_array, result_array,
                                expected_prime_count);
}

if max_primes set to 4 why expected_prime_array should have 6 item?

const uint32_t expected_prime_array[] = { 2, 3, 5, 7, 11, 13 };
......
const uint32_t result_prime_count = sieve(limit, result_array, 4);

i thinks it should be have max 4 items like expected_prime_array[] = { 2, 3, 5, 7 };

please cmiiw and thanks

That test expects only 4 primes.
The additional two elements (11 and 13) in expected_prime_array will be ignored.

But you’re right, it’s strange that the array has six element when only four of them are actually used and needed.