File: test_attr_array.sh

package info (click to toggle)
pdbg 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,212 kB
  • sloc: ansic: 21,934; cpp: 3,363; sh: 3,343; makefile: 314; asm: 11
file content (133 lines) | stat: -rwxr-xr-x 2,776 bytes parent folder | download | duplicates (2)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/sh

. $(dirname "$0")/driver.sh

FAKE_DTB=fake.dtb
TEST_DTB=fake-attr.dtb

export PDBG_DTB=$TEST_DTB

test_setup cp $FAKE_DTB $TEST_DTB
test_cleanup rm -f $TEST_DTB

test_group "libpdbg array attribute tests"

test_result 0 <<EOF
0x00 
EOF
test_run libpdbg_attr_test / read ATTR1 array 1 1

for size in 2 4 8 ; do
	test_result 88 --
	test_run libpdbg_attr_test / read ATTR1 array $size 1
done

test_result 0 <<EOF
0x0000 
EOF
test_run libpdbg_attr_test / read ATTR2 array 2 1

for size in 1 4 8 ; do
	test_result 88 --
	test_run libpdbg_attr_test / read ATTR2 array $size 1
done

test_result 0 <<EOF
0x00000000 
EOF
test_run libpdbg_attr_test / read ATTR4 array 4 1

for size in 1 2 8 ; do
	test_result 88 --
	test_run libpdbg_attr_test / read ATTR4 array $size 1
done

test_result 0 <<EOF
0x0000000000000000 
EOF
test_run libpdbg_attr_test / read ATTR8 array 8 1

for size in 1 2 4 ; do
	test_result 88 --
	test_run libpdbg_attr_test / read ATTR8 array $size 1
done

test_result 0 --
test_run libpdbg_attr_test / write ATTR1 array 1 1 0x11

test_result 0 <<EOF
0x11 
EOF
test_run libpdbg_attr_test / read ATTR1 array 1 1

test_result 0 --
test_run libpdbg_attr_test / write ATTR2 array 1 2 0x11 0x22

test_result 0 <<EOF
0x11 0x22 
EOF
test_run libpdbg_attr_test / read ATTR2 array 1 2

test_result 0 --
test_run libpdbg_attr_test / write ATTR2 array 2 1 0x1212

test_result 0 <<EOF
0x1212 
EOF
test_run libpdbg_attr_test / read ATTR2 array 2 1

test_result 0 --
test_run libpdbg_attr_test / write ATTR4 array 1 4 0x11 0x22 0x33 0x44

test_result 0 <<EOF
0x11 0x22 0x33 0x44 
EOF
test_run libpdbg_attr_test / read ATTR4 array 1 4

test_result 0 --
test_run libpdbg_attr_test / write ATTR4 array 2 2 0x1234 0x1234

test_result 0 <<EOF
0x1234 0x1234 
EOF
test_run libpdbg_attr_test / read ATTR4 array 2 2

test_result 0 --
test_run libpdbg_attr_test / write ATTR4 array 4 1 0x12345678

test_result 0 <<EOF
0x12345678 
EOF
test_run libpdbg_attr_test / read ATTR4 array 4 1

test_result 0 --
test_run libpdbg_attr_test / write ATTR8 array 1 8 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88

test_result 0 <<EOF
0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88 
EOF
test_run libpdbg_attr_test / read ATTR8 array 1 8

test_result 0 --
test_run libpdbg_attr_test / write ATTR8 array 2 4 0x1234 0x1234 0x1234 0x5678

test_result 0 <<EOF
0x1234 0x1234 0x1234 0x5678 
EOF
test_run libpdbg_attr_test / read ATTR8 array 2 4

test_result 0 --
test_run libpdbg_attr_test / write ATTR8 array 4 2 0x12345678 0x23456789

test_result 0 <<EOF
0x12345678 0x23456789 
EOF
test_run libpdbg_attr_test / read ATTR8 array 4 2

test_result 0 --
test_run libpdbg_attr_test / write ATTR8 array 8 1 0x1234567890abcdef

test_result 0 <<EOF
0x1234567890abcdef 
EOF
test_run libpdbg_attr_test / read ATTR8 array 8 1