IVGCVSW-7282 Issues in ExNet when iterations and number of inputs do not match

* The intention is to keep the flexibility given by the ExNet before the refactor.
* When iteration > inputFiles, we repeat the usage in order
* When iteration < inputFiles, we just discard extra files.

Signed-off-by: Adam Jalkemo <adam.jalkemo@arm.com>
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I2fbe69f8affe0e3a5cc86fc1748164967f0c2d64
diff --git a/tests/ExecuteNetwork/ArmNNExecutor.cpp b/tests/ExecuteNetwork/ArmNNExecutor.cpp
index 330a239..e8b5014 100644
--- a/tests/ExecuteNetwork/ArmNNExecutor.cpp
+++ b/tests/ExecuteNetwork/ArmNNExecutor.cpp
@@ -443,24 +443,29 @@
         }
     }
 
-    // Fill the remaining iterations with copies
-    const unsigned int remainingInputSets = m_Params.m_Iterations - noInputSets;
-    for (unsigned int i = 1; i <= remainingInputSets; i++)
+    // If iterations > noSets fill the remaining iterations repeating the given files
+    // If iterations < noSets just ignore the extra files
+    const unsigned int remainingInputSets = (m_Params.m_Iterations > noInputSets)
+                                          ? m_Params.m_Iterations - noInputSets
+                                          : 0;
+    for (unsigned int i = 0; i < remainingInputSets; ++i)
     {
-        m_InputTensorsVec.push_back(m_InputTensorsVec[noInputSets % i]);
+        m_InputTensorsVec.push_back(m_InputTensorsVec[i % noInputSets]);
         if (m_Params.m_ImportInputsIfAligned)
         {
-            m_ImportedInputIds.push_back(m_ImportedInputIds[noInputSets % i]);
+            m_ImportedInputIds.push_back(m_ImportedInputIds[i % noInputSets]);
         }
     }
 
-    const unsigned int remainingOutputSets = m_Params.m_Iterations - noOutputSets;
-    for (unsigned int i = 1; i <= remainingOutputSets; i++)
+    const unsigned int remainingOutputSets = (m_Params.m_Iterations > noOutputSets)
+                                           ? m_Params.m_Iterations - noOutputSets
+                                           : 0;
+    for (unsigned int i = 0; i < remainingOutputSets; ++i)
     {
-        m_OutputTensorsVec.push_back(m_OutputTensorsVec[noOutputSets % i]);
+        m_OutputTensorsVec.push_back(m_OutputTensorsVec[i % noOutputSets]);
         if (m_Params.m_ImportInputsIfAligned)
         {
-            m_ImportedOutputIds.push_back(m_ImportedOutputIds[noOutputSets % i]);
+            m_ImportedOutputIds.push_back(m_ImportedOutputIds[i % noOutputSets]);
         }
     }
 }