From: Luke Kenneth Casson Leighton Date: Fri, 17 Nov 2023 13:02:10 +0000 (+0000) Subject: add asserts to check results X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2aa4e5c2ce14e102642a3ea42fa58d088706573f;p=openpower-isa.git add asserts to check results --- 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)