summaryrefslogtreecommitdiffstats
path: root/src/tests/keywords/update-array
blob: c872f4e834f9e7e9c88309dc88c0417c9759923d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
#  PRE: update array
#

update request {
       Class := 0x01020304
       Class += 0x05060708
       Class += 0x090a0b0c
}


#
#  Use array references in the RHS
#  of the update section
#

update request {
       Proxy-State += &Class[0]
       Proxy-State += &Class[1]
       Proxy-State += &Class[2]
}

if (&Proxy-State != 0x01020304) {
	update reply {
		Filter-Id := "fail 0"
	}
}

#  Must be the same as above
if (&Proxy-State[0] != 0x01020304) {
	update reply {
		Filter-Id += "fail 0a"
	}
}

if (&Proxy-State[1] != 0x05060708) {
	update reply {
		Filter-Id += "fail 1"
	}
}

if (&Proxy-State[2] != 0x090a0b0c) {
	update reply {
		Filter-Id += "fail 2"
	}
}

# must not exist
if (&Proxy-State[3]) {
	update reply {
		Filter-Id += "fail 3"
	}
}

#
#  The test passes only if no test above
#  added a Filter-Id
#
if (!reply:Filter-Id) {
	update reply {
		Filter-Id := "filter"
	}
}