projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
drivers
/
staging
/
ktap
/
test
/
looping.kp
1
#!/usr/bin/env ktap
2
3
function failed() {
4
printf("failed\n");
5
exit(-1);
6
}
7
8
### basic while-loop testing
9
a = 1
10
while (a < 1000) {
11
a = a + 1
12
}
13
14
if (a != 1000) {
15
failed()
16
}
17
18
### break testing
19
### Note that ktap don't have continue keyword
20
a = 1
21
while (a < 1000) {
22
if (a == 10) {
23
break
24
}
25
a = a + 1
26
}
27
28
if (a != 10) {
29
failed()
30
}
31
32
### for-loop testing
33
b=0
34
for (c = 0, 1000, 1) {
35
b = b + 1
36
}
37
38
if (b != 1001) {
39
failed()
40
}