Skip to content

Commit

Permalink
Review Feedback Vol. 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Jan 12, 2025
1 parent 6d8dc3c commit 3dfd907
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@ private static class DataProviderMultiplier extends BaseDataIterator {
*/
private final int estimatedNumIterations;

/**
* The amount how many data providers are processed by this data provider multiplier.
*/
private final int processedDataProviders;

/**
* Creates a new data provider multiplier that handles two sets of plain data providers as factors.
* If the sizes of the providers in at least one of the sets can be estimated,
Expand Down Expand Up @@ -756,6 +761,8 @@ public DataProviderMultiplier(IRunSupervisor supervisor, SpockExecutionContext c
? UNKNOWN_ITERATIONS
: estimatedMultiplierIterations * estimatedMultiplicandIterations;

processedDataProviders = multiplierProviders.length + multiplicandProviders.length;

if ((estimatedMultiplierIterations != UNKNOWN_ITERATIONS)
&& ((estimatedMultiplicandIterations == UNKNOWN_ITERATIONS) || (estimatedMultiplicandIterations > estimatedMultiplierIterations))) {
// multiplier is not unknown and multiplicand is unknown or larger,
Expand Down Expand Up @@ -803,6 +810,8 @@ public DataProviderMultiplier(IRunSupervisor supervisor, SpockExecutionContext c
? UNKNOWN_ITERATIONS
: estimatedMultiplierIterations * estimatedMultiplicandIterations;

processedDataProviders = multiplierProvider.getProcessedDataProviders() + multiplicandProviders.length;

if ((estimatedMultiplierIterations != UNKNOWN_ITERATIONS)
&& ((estimatedMultiplicandIterations == UNKNOWN_ITERATIONS) || (estimatedMultiplicandIterations > estimatedMultiplierIterations))) {
// multiplier is not unknown and multiplicand is unknown or larger,
Expand Down Expand Up @@ -940,18 +949,7 @@ public List<String> getDataVariableNames() {
* @return how many data providers are processed by this data provider multiplier
*/
public int getProcessedDataProviders() {
int result = 0;
if (multiplierProvider != null) {
result += multiplierProvider.getProcessedDataProviders();
} else if (multiplierProviders != null) {
result += multiplierProviders.length;
}
if (multiplicandProvider != null) {
result += multiplicandProvider.getProcessedDataProviders();
} else if (multiplicandProviders != null) {
result += multiplicandProviders.length;
}
return result;
return processedDataProviders;
}

private Iterator<?>[] createIterators(Object[] dataProviders, List<DataProviderInfo> dataProviderInfos) {
Expand Down

0 comments on commit 3dfd907

Please sign in to comment.