4
4
"runtime"
5
5
"testing"
6
6
"unsafe"
7
-
8
- "go.bytecodealliance.org/internal/tinyunsafe"
9
7
)
10
8
11
9
func TestFieldAlignment (t * testing.T ) {
@@ -18,7 +16,7 @@ func TestFieldAlignment(t *testing.T) {
18
16
if got , want := unsafe .Sizeof (v1 ), uintptr (16 ); got != want {
19
17
t .Errorf ("unsafe.Sizeof(v1): %d, expected %d" , got , want )
20
18
}
21
- if got , want := tinyunsafe . OffsetOf (& v1 , & v1 .u64 ), uintptr (8 ); got != want {
19
+ if got , want := offsetOf (& v1 , & v1 .u64 ), uintptr (8 ); got != want {
22
20
t .Errorf ("unsafe.Offsetof(v1.u64): %d, expected %d" , got , want )
23
21
}
24
22
@@ -36,7 +34,7 @@ func TestFieldAlignment(t *testing.T) {
36
34
if got , want := unsafe .Sizeof (v2 ), uintptr (16 ); got != want {
37
35
t .Errorf ("unsafe.Sizeof(v2): %d, expected %d" , got , want )
38
36
}
39
- if got , want := tinyunsafe . OffsetOf (& v2 , & v2 .u64 ), uintptr (8 ); got != want {
37
+ if got , want := offsetOf (& v2 , & v2 .u64 ), uintptr (8 ); got != want {
40
38
t .Errorf ("unsafe.Offsetof(v2.u64): %d, expected %d" , got , want )
41
39
}
42
40
@@ -49,7 +47,7 @@ func TestFieldAlignment(t *testing.T) {
49
47
if got , want := unsafe .Sizeof (v3 ), uintptr (1 ); got != want {
50
48
t .Errorf ("unsafe.Sizeof(v3): %d, expected %d" , got , want )
51
49
}
52
- if got , want := tinyunsafe . OffsetOf (& v3 , & v3 .b ), uintptr (0 ); got != want {
50
+ if got , want := offsetOf (& v3 , & v3 .b ), uintptr (0 ); got != want {
53
51
t .Errorf ("unsafe.Offsetof(v3.b): %d, expected %d" , got , want )
54
52
}
55
53
@@ -62,7 +60,7 @@ func TestFieldAlignment(t *testing.T) {
62
60
if got , want := unsafe .Sizeof (v4 ), uintptr (4 ); got != want {
63
61
t .Errorf ("unsafe.Sizeof(v4): %d, expected %d" , got , want )
64
62
}
65
- if got , want := tinyunsafe . OffsetOf (& v4 , & v4 .b ), uintptr (0 ); got != want {
63
+ if got , want := offsetOf (& v4 , & v4 .b ), uintptr (0 ); got != want {
66
64
t .Errorf ("unsafe.Offsetof(v4.b): %d, expected %d" , got , want )
67
65
}
68
66
}
0 commit comments