diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-05-30 12:17:18 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-05-30 12:17:18 -0400 |
commit | 2348cdbe2a3417990a2088f9e4e91adf0c45617d (patch) | |
tree | 031b60037b3fc91d4191b936682f46e0652e07c9 /pkg/binstruct/binstruct_test.go | |
parent | 5cc9d7718fecd0b2b91dcf5acb5d92316c752570 (diff) |
fix
Diffstat (limited to 'pkg/binstruct/binstruct_test.go')
-rw-r--r-- | pkg/binstruct/binstruct_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/binstruct/binstruct_test.go b/pkg/binstruct/binstruct_test.go index 00c9e37..83a1747 100644 --- a/pkg/binstruct/binstruct_test.go +++ b/pkg/binstruct/binstruct_test.go @@ -41,6 +41,8 @@ func TestSmoke(t *testing.T) { binstruct.End `bin:"off=0x6F"` } + assert.Equal(t, 0x6F, binstruct.StaticSize(TestType{})) + input := TestType{} copy(input.Magic[:], "mAgIc") input.Dev.DeviceID = 12 @@ -48,7 +50,7 @@ func TestSmoke(t *testing.T) { bs, err := binstruct.Marshal(input) assert.NoError(t, err) - assert.True(t, len(bs) == 0x6F, "len(bs)=0x%x", len(bs)) + assert.Equal(t, 0x6F, len(bs)) var output TestType n, err := binstruct.Unmarshal(bs, &output) |