From bf45da5e6fc8ab6dc5d86b71399c0a375db28429 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 17 Nov 2023 13:02:10 +0000 Subject: [PATCH] add asserts to check results --- src/openpower/decoder/isa/maxloc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/isa/maxloc.py b/src/openpower/decoder/isa/maxloc.py index 740b287c..c07de4d5 100644 --- a/src/openpower/decoder/isa/maxloc.py +++ b/src/openpower/decoder/isa/maxloc.py @@ -22,14 +22,16 @@ if __name__ == '__main__': print("search list", arr) result = m2(arr) print("Index of the maximum value in an array is: %d" % result) - + assert (result == 6) arr = [5,2,8,9,9,7,9,4] print("search list", arr) result = m2(arr) print("Index of the maximum value in an array is: %d" % result) + assert (result == 3) arr = [0,0,0,0,0,0,0,0] print("search list", arr) result = m2(arr) print("Index of the maximum value in an array is: %d" % result) + assert (result == 0) -- 2.30.2