Refactor kafka to pure Go (franz-go), fix DBC stubs, update Dockerfile
This commit is contained in:
27
pkg/can-go/frame_test.go
Normal file
27
pkg/can-go/frame_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package can
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
"unsafe"
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
)
|
||||
|
||||
// If this mocks ever starts failing, the documentation needs to be updated
|
||||
// to prefer pass-by-pointer over pass-by-value.
|
||||
func TestFrame_Size(t *testing.T) {
|
||||
assert.Assert(t, unsafe.Sizeof(Frame{}) <= 16, "Frame size is <= 16 bytes")
|
||||
}
|
||||
|
||||
func TestFrame_Validate_Error(t *testing.T) {
|
||||
for _, tt := range []Frame{
|
||||
{ID: MaxID + 1},
|
||||
{ID: MaxExtendedID + 1, IsExtended: true},
|
||||
} {
|
||||
tt := tt
|
||||
t.Run(fmt.Sprintf("%v", tt), func(t *testing.T) {
|
||||
assert.Check(t, tt.Validate() != nil, "should return validation error")
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user