From fc4ec2b74d8b3710f3c62a6392fcf75f3af3ac76 Mon Sep 17 00:00:00 2001 From: Moritz Scherer Date: Thu, 17 Oct 2024 14:20:14 +0200 Subject: [PATCH] Add failure indication in testCluster --- sw/tests/testCluster.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sw/tests/testCluster.c b/sw/tests/testCluster.c index 1cc4a24..528965c 100644 --- a/sw/tests/testCluster.c +++ b/sw/tests/testCluster.c @@ -26,11 +26,15 @@ int main() { clusterMemPtr = (volatile int32_t *)CLUSTERMEMORYSTART; for (int i = 0; i < NUMCLUSTERS; i++) { result = *(clusterMemPtr); - ret += (result == TESTVAL); + if (result == TESTVAL) { + ret += 1; + } else { + ret += 1 << (NUMCLUSTERS+i); + } clusterMemPtr += CLUSTERDISTANCE / 4; } - if (ret == NUMCLUSTERS) { + if ((ret & ((1 << NUMCLUSTERS)-1)) == NUMCLUSTERS) { return 0; }