Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/rand.stp

raw
1 function checkStatus(status:long){
2 if (status == 1){
3 printf("%s\n","FAIL")
4 }else{
5 printf("%s\n","PASS")
6 }
7 }
8
9 probe begin
10 {
11 status = 0
12 for (i=1; i <= 100; i++){
13 if (randint(i) < 0 || randint(i) > i) {
14 status = 1
15 }
16 }
17 checkStatus(status)
18 exit()
19 }