Maximum allowed length for an array passed as test input.


Diffblue Cover is not limited in the size of arrays it can create when generating inputs for a method. However, if these arrays hold complex objects, Diffblue Cover may not be able to cover them. In order to avoid this, you can set a limit to the size of any input arrays. It can be overridden with the max-nondet-array-length option.


To be able to create tests for the example below, you should set max-nondet-array-length to 8 or higher:

public static int func(int[] array) {
  if (array[7] == 2)
  return 2;
  return 1;

Limiting the size of the generated input arrays can also help with the readability of tests. Note that it makes sense to have an unwind value that is greater than max-nondet-array-length.

    max-nondet-array-length: 8

results matching ""

    No results matching ""