aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/TestUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'delegate/src/test/TestUtils.cpp')
-rw-r--r--delegate/src/test/TestUtils.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/delegate/src/test/TestUtils.cpp b/delegate/src/test/TestUtils.cpp
index 1bc5786112..bbe89904eb 100644
--- a/delegate/src/test/TestUtils.cpp
+++ b/delegate/src/test/TestUtils.cpp
@@ -52,6 +52,15 @@ void CompareData(int16_t tensor1[], int16_t tensor2[], size_t tensorSize)
}
}
+void CompareData(int32_t tensor1[], int32_t tensor2[], size_t tensorSize)
+{
+ int32_t tolerance = 1;
+ for (size_t i = 0; i < tensorSize; i++)
+ {
+ CHECK(std::max(tensor1[i], tensor2[i]) - std::min(tensor1[i], tensor2[i]) <= tolerance);
+ }
+}
+
void CompareData(int8_t tensor1[], int8_t tensor2[], size_t tensorSize)
{
int8_t tolerance = 1;