blob: f361a897ae5c364ebe6bc6b6507b684cfc96a873 [file] [log] [blame]
// Copyright The Monogon Project Authors.
// SPDX-License-Identifier: Apache-2.0
package fat32
import (
"encoding/binary"
"reflect"
"testing"
)
func TestStructureSizes(t *testing.T) {
cases := []struct {
StructInstance interface{}
ExpectedSize int
}{
{bootSector{}, 512},
{fsinfo{}, 512},
{dirEntry{}, 32},
{lfnEntry{}, 32},
}
for _, c := range cases {
t.Run(reflect.TypeOf(c.StructInstance).String(), func(t *testing.T) {
actualSize := binary.Size(c.StructInstance)
if actualSize != c.ExpectedSize {
t.Errorf("Expected %d bytes, got %d", c.ExpectedSize, actualSize)
}
})
}
}