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=bf45da5e6fc8ab6dc5d86b71399c0a375db28429;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)