gotelem/skylab/skylab_gen_test.go

4601 lines
86 KiB
Go
Raw Normal View History

2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
package skylab
import (
2024-03-07 12:18:49 +00:00
"testing"
2024-03-07 19:29:50 +00:00
"reflect"
"encoding/json"
2023-05-19 22:04:03 +00:00
)
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalBmsMeasurement(t *testing.T) {
v := &BmsMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsMeasurement(t *testing.T) {
v := &BmsMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsMeasurement(t *testing.T) {
v := &BmsMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBatteryStatus(t *testing.T) {
v := &BatteryStatus{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBatteryStatus(t *testing.T) {
v := &BatteryStatus{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BatteryStatus:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBatteryStatus(t *testing.T) {
v := &BatteryStatus{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsKillReason(t *testing.T) {
v := &BmsKillReason{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsKillReason(t *testing.T) {
v := &BmsKillReason{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsKillReason:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsKillReason(t *testing.T) {
v := &BmsKillReason{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsModuleMinMax(t *testing.T) {
v := &BmsModuleMinMax{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsModuleMinMax(t *testing.T) {
v := &BmsModuleMinMax{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsModuleMinMax:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsModuleMinMax(t *testing.T) {
v := &BmsModuleMinMax{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsSoc(t *testing.T) {
v := &BmsSoc{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsSoc(t *testing.T) {
v := &BmsSoc{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsSoc:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameBmsSoc(t *testing.T) {
v := &BmsSoc{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalBmsCapacity(t *testing.T) {
v := &BmsCapacity{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsCapacity(t *testing.T) {
v := &BmsCapacity{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsCapacity:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsCapacity(t *testing.T) {
v := &BmsCapacity{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsCurrentlimit(t *testing.T) {
v := &BmsCurrentlimit{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsCurrentlimit(t *testing.T) {
v := &BmsCurrentlimit{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsCurrentlimit:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsCurrentlimit(t *testing.T) {
v := &BmsCurrentlimit{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsFanInfo(t *testing.T) {
v := &BmsFanInfo{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsFanInfo(t *testing.T) {
v := &BmsFanInfo{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsFanInfo:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsFanInfo(t *testing.T) {
v := &BmsFanInfo{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsSetMinFanSpeed(t *testing.T) {
v := &BmsSetMinFanSpeed{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsSetMinFanSpeed(t *testing.T) {
v := &BmsSetMinFanSpeed{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsSetMinFanSpeed:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsSetMinFanSpeed(t *testing.T) {
v := &BmsSetMinFanSpeed{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsModule(t *testing.T) {
v := &BmsModule{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsModule(t *testing.T) {
v := &BmsModule{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsModule:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsModule(t *testing.T) {
v := &BmsModule{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsChargerResponse(t *testing.T) {
v := &BmsChargerResponse{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsChargerResponse(t *testing.T) {
v := &BmsChargerResponse{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsChargerResponse:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameBmsChargerResponse(t *testing.T) {
v := &BmsChargerResponse{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalChassisIsolationFault(t *testing.T) {
v := &ChassisIsolationFault{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONChassisIsolationFault(t *testing.T) {
v := &ChassisIsolationFault{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ChassisIsolationFault:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameChassisIsolationFault(t *testing.T) {
v := &ChassisIsolationFault{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalBmsImdInfo(t *testing.T) {
v := &BmsImdInfo{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsImdInfo(t *testing.T) {
v := &BmsImdInfo{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsImdInfo:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameBmsImdInfo(t *testing.T) {
v := &BmsImdInfo{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalDashboardPedalPercentages(t *testing.T) {
v := &DashboardPedalPercentages{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONDashboardPedalPercentages(t *testing.T) {
v := &DashboardPedalPercentages{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *DashboardPedalPercentages:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameDashboardPedalPercentages(t *testing.T) {
v := &DashboardPedalPercentages{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalCarState(t *testing.T) {
v := &CarState{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONCarState(t *testing.T) {
v := &CarState{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *CarState:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameCarState(t *testing.T) {
v := &CarState{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalDashboardPedalFault(t *testing.T) {
v := &DashboardPedalFault{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONDashboardPedalFault(t *testing.T) {
v := &DashboardPedalFault{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *DashboardPedalFault:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameDashboardPedalFault(t *testing.T) {
v := &DashboardPedalFault{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalDashboardSystemTimeoutTest(t *testing.T) {
v := &DashboardSystemTimeoutTest{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONDashboardSystemTimeoutTest(t *testing.T) {
v := &DashboardSystemTimeoutTest{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *DashboardSystemTimeoutTest:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameDashboardSystemTimeoutTest(t *testing.T) {
v := &DashboardSystemTimeoutTest{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalCarSpeed(t *testing.T) {
v := &CarSpeed{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONCarSpeed(t *testing.T) {
v := &CarSpeed{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *CarSpeed:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameCarSpeed(t *testing.T) {
v := &CarSpeed{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalFlightComputerLvBoardDisconnectCounts(t *testing.T) {
v := &FlightComputerLvBoardDisconnectCounts{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONFlightComputerLvBoardDisconnectCounts(t *testing.T) {
v := &FlightComputerLvBoardDisconnectCounts{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *FlightComputerLvBoardDisconnectCounts:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameFlightComputerLvBoardDisconnectCounts(t *testing.T) {
v := &FlightComputerLvBoardDisconnectCounts{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalFlightComputerHvBoardDisconnectCounts(t *testing.T) {
v := &FlightComputerHvBoardDisconnectCounts{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONFlightComputerHvBoardDisconnectCounts(t *testing.T) {
v := &FlightComputerHvBoardDisconnectCounts{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *FlightComputerHvBoardDisconnectCounts:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameFlightComputerHvBoardDisconnectCounts(t *testing.T) {
v := &FlightComputerHvBoardDisconnectCounts{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalFlightComputerInternalState(t *testing.T) {
v := &FlightComputerInternalState{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONFlightComputerInternalState(t *testing.T) {
v := &FlightComputerInternalState{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *FlightComputerInternalState:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameFlightComputerInternalState(t *testing.T) {
v := &FlightComputerInternalState{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalPowerToDrive(t *testing.T) {
v := &PowerToDrive{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONPowerToDrive(t *testing.T) {
v := &PowerToDrive{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *PowerToDrive:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFramePowerToDrive(t *testing.T) {
v := &PowerToDrive{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalArrayPower(t *testing.T) {
v := &ArrayPower{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONArrayPower(t *testing.T) {
v := &ArrayPower{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ArrayPower:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameArrayPower(t *testing.T) {
v := &ArrayPower{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalArrayEnergy(t *testing.T) {
v := &ArrayEnergy{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONArrayEnergy(t *testing.T) {
v := &ArrayEnergy{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ArrayEnergy:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameArrayEnergy(t *testing.T) {
v := &ArrayEnergy{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalArrayEnergyReset(t *testing.T) {
v := &ArrayEnergyReset{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONArrayEnergyReset(t *testing.T) {
v := &ArrayEnergyReset{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ArrayEnergyReset:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameArrayEnergyReset(t *testing.T) {
v := &ArrayEnergyReset{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalVisionTurnSignalsCommand(t *testing.T) {
v := &VisionTurnSignalsCommand{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionTurnSignalsCommand(t *testing.T) {
v := &VisionTurnSignalsCommand{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionTurnSignalsCommand:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameVisionTurnSignalsCommand(t *testing.T) {
v := &VisionTurnSignalsCommand{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalVisionBrakeLightsCommand(t *testing.T) {
v := &VisionBrakeLightsCommand{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionBrakeLightsCommand(t *testing.T) {
v := &VisionBrakeLightsCommand{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionBrakeLightsCommand:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameVisionBrakeLightsCommand(t *testing.T) {
v := &VisionBrakeLightsCommand{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalVisionHeadlightsCommand(t *testing.T) {
v := &VisionHeadlightsCommand{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionHeadlightsCommand(t *testing.T) {
v := &VisionHeadlightsCommand{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionHeadlightsCommand:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameVisionHeadlightsCommand(t *testing.T) {
v := &VisionHeadlightsCommand{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalVisionHornCommand(t *testing.T) {
v := &VisionHornCommand{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionHornCommand(t *testing.T) {
v := &VisionHornCommand{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionHornCommand:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameVisionHornCommand(t *testing.T) {
v := &VisionHornCommand{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalVisionArrayLatchesCommand(t *testing.T) {
v := &VisionArrayLatchesCommand{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionArrayLatchesCommand(t *testing.T) {
v := &VisionArrayLatchesCommand{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionArrayLatchesCommand:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameVisionArrayLatchesCommand(t *testing.T) {
v := &VisionArrayLatchesCommand{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalVisionRearviewCommand(t *testing.T) {
v := &VisionRearviewCommand{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionRearviewCommand(t *testing.T) {
v := &VisionRearviewCommand{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionRearviewCommand:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameVisionRearviewCommand(t *testing.T) {
v := &VisionRearviewCommand{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalTrackerEnable(t *testing.T) {
v := &TrackerEnable{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTrackerEnable(t *testing.T) {
v := &TrackerEnable{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TrackerEnable:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTrackerEnable(t *testing.T) {
v := &TrackerEnable{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalDistanceTraveled(t *testing.T) {
v := &DistanceTraveled{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONDistanceTraveled(t *testing.T) {
v := &DistanceTraveled{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *DistanceTraveled:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameDistanceTraveled(t *testing.T) {
v := &DistanceTraveled{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalChargerState(t *testing.T) {
v := &ChargerState{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONChargerState(t *testing.T) {
v := &ChargerState{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ChargerState:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameChargerState(t *testing.T) {
v := &ChargerState{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalChargerBmsRequest(t *testing.T) {
v := &ChargerBmsRequest{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONChargerBmsRequest(t *testing.T) {
v := &ChargerBmsRequest{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ChargerBmsRequest:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameChargerBmsRequest(t *testing.T) {
v := &ChargerBmsRequest{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalChargerCurrentVoltage(t *testing.T) {
v := &ChargerCurrentVoltage{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONChargerCurrentVoltage(t *testing.T) {
v := &ChargerCurrentVoltage{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ChargerCurrentVoltage:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameChargerCurrentVoltage(t *testing.T) {
v := &ChargerCurrentVoltage{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalChargerPower(t *testing.T) {
v := &ChargerPower{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONChargerPower(t *testing.T) {
v := &ChargerPower{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ChargerPower:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameChargerPower(t *testing.T) {
v := &ChargerPower{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalThunderstruckControlMessage(t *testing.T) {
v := &ThunderstruckControlMessage{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONThunderstruckControlMessage(t *testing.T) {
v := &ThunderstruckControlMessage{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ThunderstruckControlMessage:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameThunderstruckControlMessage(t *testing.T) {
v := &ThunderstruckControlMessage{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalVisionStatusFront(t *testing.T) {
v := &VisionStatusFront{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionStatusFront(t *testing.T) {
v := &VisionStatusFront{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionStatusFront:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameVisionStatusFront(t *testing.T) {
v := &VisionStatusFront{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalVisionStatusRear(t *testing.T) {
v := &VisionStatusRear{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionStatusRear(t *testing.T) {
v := &VisionStatusRear{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionStatusRear:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameVisionStatusRear(t *testing.T) {
v := &VisionStatusRear{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalLightsFrontId(t *testing.T) {
v := &LightsFrontId{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONLightsFrontId(t *testing.T) {
v := &LightsFrontId{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *LightsFrontId:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameLightsFrontId(t *testing.T) {
v := &LightsFrontId{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalLightsBackId(t *testing.T) {
v := &LightsBackId{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONLightsBackId(t *testing.T) {
v := &LightsBackId{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *LightsBackId:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameLightsBackId(t *testing.T) {
v := &LightsBackId{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalVisionId(t *testing.T) {
v := &VisionId{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONVisionId(t *testing.T) {
v := &VisionId{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *VisionId:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameVisionId(t *testing.T) {
v := &VisionId{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalSteeringPressCount1(t *testing.T) {
v := &SteeringPressCount1{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONSteeringPressCount1(t *testing.T) {
v := &SteeringPressCount1{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *SteeringPressCount1:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameSteeringPressCount1(t *testing.T) {
v := &SteeringPressCount1{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalSteeringPressCount2(t *testing.T) {
v := &SteeringPressCount2{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONSteeringPressCount2(t *testing.T) {
v := &SteeringPressCount2{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *SteeringPressCount2:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameSteeringPressCount2(t *testing.T) {
v := &SteeringPressCount2{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalSteeringButtonColors1(t *testing.T) {
v := &SteeringButtonColors1{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONSteeringButtonColors1(t *testing.T) {
v := &SteeringButtonColors1{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *SteeringButtonColors1:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameSteeringButtonColors1(t *testing.T) {
v := &SteeringButtonColors1{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalSteeringButtonColors2(t *testing.T) {
v := &SteeringButtonColors2{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONSteeringButtonColors2(t *testing.T) {
v := &SteeringButtonColors2{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *SteeringButtonColors2:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
func TestCanFrameSteeringButtonColors2(t *testing.T) {
v := &SteeringButtonColors2{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalSteeringHorn(t *testing.T) {
v := &SteeringHorn{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONSteeringHorn(t *testing.T) {
v := &SteeringHorn{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *SteeringHorn:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameSteeringHorn(t *testing.T) {
v := &SteeringHorn{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalThunderstruckStatusMessage(t *testing.T) {
v := &ThunderstruckStatusMessage{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONThunderstruckStatusMessage(t *testing.T) {
v := &ThunderstruckStatusMessage{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *ThunderstruckStatusMessage:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameThunderstruckStatusMessage(t *testing.T) {
v := &ThunderstruckStatusMessage{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalTrackerData(t *testing.T) {
v := &TrackerData{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTrackerData(t *testing.T) {
v := &TrackerData{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TrackerData:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTrackerData(t *testing.T) {
v := &TrackerData{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalTritiumMotorDriveL(t *testing.T) {
v := &TritiumMotorDriveL{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTritiumMotorDriveL(t *testing.T) {
v := &TritiumMotorDriveL{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TritiumMotorDriveL:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTritiumMotorDriveL(t *testing.T) {
v := &TritiumMotorDriveL{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalTritiumMotorPowerL(t *testing.T) {
v := &TritiumMotorPowerL{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTritiumMotorPowerL(t *testing.T) {
v := &TritiumMotorPowerL{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TritiumMotorPowerL:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameTritiumMotorPowerL(t *testing.T) {
v := &TritiumMotorPowerL{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalTritiumResetL(t *testing.T) {
v := &TritiumResetL{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTritiumResetL(t *testing.T) {
v := &TritiumResetL{}
rawData, err := json.Marshal(v)
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TritiumResetL:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTritiumResetL(t *testing.T) {
v := &TritiumResetL{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalTritiumMotorDriveR(t *testing.T) {
v := &TritiumMotorDriveR{}
2023-05-19 22:04:03 +00:00
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTritiumMotorDriveR(t *testing.T) {
2023-05-19 22:04:03 +00:00
v := &TritiumMotorDriveR{}
2023-05-19 22:04:03 +00:00
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TritiumMotorDriveR:
2023-05-19 22:04:03 +00:00
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTritiumMotorDriveR(t *testing.T) {
v := &TritiumMotorDriveR{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalTritiumMotorPowerR(t *testing.T) {
v := &TritiumMotorPowerR{}
2023-05-19 22:04:03 +00:00
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTritiumMotorPowerR(t *testing.T) {
2023-05-19 22:04:03 +00:00
v := &TritiumMotorPowerR{}
2023-05-19 22:04:03 +00:00
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TritiumMotorPowerR:
2023-05-19 22:04:03 +00:00
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTritiumMotorPowerR(t *testing.T) {
v := &TritiumMotorPowerR{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
func TestMarshalUnmarshalTritiumResetR(t *testing.T) {
v := &TritiumResetR{}
2023-05-19 22:04:03 +00:00
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTritiumResetR(t *testing.T) {
2023-05-19 22:04:03 +00:00
v := &TritiumResetR{}
2023-05-19 22:04:03 +00:00
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TritiumResetR:
2023-05-19 22:04:03 +00:00
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameTritiumResetR(t *testing.T) {
v := &TritiumResetR{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalBmsAhSet(t *testing.T) {
v := &BmsAhSet{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsAhSet(t *testing.T) {
v := &BmsAhSet{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsAhSet:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameBmsAhSet(t *testing.T) {
v := &BmsAhSet{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalBmsWhSet(t *testing.T) {
v := &BmsWhSet{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsWhSet(t *testing.T) {
v := &BmsWhSet{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsWhSet:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameBmsWhSet(t *testing.T) {
v := &BmsWhSet{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalBmsKill(t *testing.T) {
v := &BmsKill{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONBmsKill(t *testing.T) {
v := &BmsKill{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *BmsKill:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameBmsKill(t *testing.T) {
v := &BmsKill{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalTelemetryRtcReset(t *testing.T) {
v := &TelemetryRtcReset{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONTelemetryRtcReset(t *testing.T) {
v := &TelemetryRtcReset{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *TelemetryRtcReset:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameTelemetryRtcReset(t *testing.T) {
v := &TelemetryRtcReset{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalWsrIdentification(t *testing.T) {
v := &WsrIdentification{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrIdentification(t *testing.T) {
v := &WsrIdentification{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrIdentification:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrIdentification(t *testing.T) {
v := &WsrIdentification{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrStatusInformation(t *testing.T) {
v := &WsrStatusInformation{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrStatusInformation(t *testing.T) {
v := &WsrStatusInformation{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrStatusInformation:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrStatusInformation(t *testing.T) {
v := &WsrStatusInformation{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrBusMeasurement(t *testing.T) {
v := &WsrBusMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrBusMeasurement(t *testing.T) {
v := &WsrBusMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrBusMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrBusMeasurement(t *testing.T) {
v := &WsrBusMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrVelocity(t *testing.T) {
v := &WsrVelocity{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrVelocity(t *testing.T) {
v := &WsrVelocity{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrVelocity:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrVelocity(t *testing.T) {
v := &WsrVelocity{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrPhaseCurrent(t *testing.T) {
v := &WsrPhaseCurrent{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrPhaseCurrent(t *testing.T) {
v := &WsrPhaseCurrent{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrPhaseCurrent:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrPhaseCurrent(t *testing.T) {
v := &WsrPhaseCurrent{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrMotorVoltageVector(t *testing.T) {
v := &WsrMotorVoltageVector{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrMotorVoltageVector(t *testing.T) {
v := &WsrMotorVoltageVector{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrMotorVoltageVector:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrMotorVoltageVector(t *testing.T) {
v := &WsrMotorVoltageVector{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrMotorCurrentVector(t *testing.T) {
v := &WsrMotorCurrentVector{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrMotorCurrentVector(t *testing.T) {
v := &WsrMotorCurrentVector{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrMotorCurrentVector:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameWsrMotorCurrentVector(t *testing.T) {
v := &WsrMotorCurrentVector{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalWsrMotorBackemf(t *testing.T) {
v := &WsrMotorBackemf{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrMotorBackemf(t *testing.T) {
v := &WsrMotorBackemf{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrMotorBackemf:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrMotorBackemf(t *testing.T) {
v := &WsrMotorBackemf{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsr15165VoltageRail(t *testing.T) {
v := &Wsr15165VoltageRail{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsr15165VoltageRail(t *testing.T) {
v := &Wsr15165VoltageRail{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *Wsr15165VoltageRail:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsr15165VoltageRail(t *testing.T) {
v := &Wsr15165VoltageRail{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsr2512VoltageRail(t *testing.T) {
v := &Wsr2512VoltageRail{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsr2512VoltageRail(t *testing.T) {
v := &Wsr2512VoltageRail{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *Wsr2512VoltageRail:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsr2512VoltageRail(t *testing.T) {
v := &Wsr2512VoltageRail{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrHeatsinkMotorTemp(t *testing.T) {
v := &WsrHeatsinkMotorTemp{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrHeatsinkMotorTemp(t *testing.T) {
v := &WsrHeatsinkMotorTemp{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrHeatsinkMotorTemp:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrHeatsinkMotorTemp(t *testing.T) {
v := &WsrHeatsinkMotorTemp{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrDspBoardTemp(t *testing.T) {
v := &WsrDspBoardTemp{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrDspBoardTemp(t *testing.T) {
v := &WsrDspBoardTemp{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrDspBoardTemp:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrDspBoardTemp(t *testing.T) {
v := &WsrDspBoardTemp{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrReserved(t *testing.T) {
v := &WsrReserved{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrReserved(t *testing.T) {
v := &WsrReserved{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrReserved:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrReserved(t *testing.T) {
v := &WsrReserved{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrOdometerBusAmphoursMeasurement(t *testing.T) {
v := &WsrOdometerBusAmphoursMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrOdometerBusAmphoursMeasurement(t *testing.T) {
v := &WsrOdometerBusAmphoursMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrOdometerBusAmphoursMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsrOdometerBusAmphoursMeasurement(t *testing.T) {
v := &WsrOdometerBusAmphoursMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsrSlipSpeedMeasurement(t *testing.T) {
v := &WsrSlipSpeedMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsrSlipSpeedMeasurement(t *testing.T) {
v := &WsrSlipSpeedMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WsrSlipSpeedMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameWsrSlipSpeedMeasurement(t *testing.T) {
v := &WsrSlipSpeedMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalWslIdentification(t *testing.T) {
v := &WslIdentification{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslIdentification(t *testing.T) {
v := &WslIdentification{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslIdentification:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslIdentification(t *testing.T) {
v := &WslIdentification{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslStatusInformation(t *testing.T) {
v := &WslStatusInformation{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslStatusInformation(t *testing.T) {
v := &WslStatusInformation{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslStatusInformation:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslStatusInformation(t *testing.T) {
v := &WslStatusInformation{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslBusMeasurement(t *testing.T) {
v := &WslBusMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslBusMeasurement(t *testing.T) {
v := &WslBusMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslBusMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslBusMeasurement(t *testing.T) {
v := &WslBusMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslVelocity(t *testing.T) {
v := &WslVelocity{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslVelocity(t *testing.T) {
v := &WslVelocity{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslVelocity:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslVelocity(t *testing.T) {
v := &WslVelocity{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslPhaseCurrent(t *testing.T) {
v := &WslPhaseCurrent{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslPhaseCurrent(t *testing.T) {
v := &WslPhaseCurrent{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslPhaseCurrent:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslPhaseCurrent(t *testing.T) {
v := &WslPhaseCurrent{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslMotorVoltageVector(t *testing.T) {
v := &WslMotorVoltageVector{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslMotorVoltageVector(t *testing.T) {
v := &WslMotorVoltageVector{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslMotorVoltageVector:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslMotorVoltageVector(t *testing.T) {
v := &WslMotorVoltageVector{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslMotorCurrentVector(t *testing.T) {
v := &WslMotorCurrentVector{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslMotorCurrentVector(t *testing.T) {
v := &WslMotorCurrentVector{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslMotorCurrentVector:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslMotorCurrentVector(t *testing.T) {
v := &WslMotorCurrentVector{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslMotorBackemf(t *testing.T) {
v := &WslMotorBackemf{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslMotorBackemf(t *testing.T) {
v := &WslMotorBackemf{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslMotorBackemf:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
2023-05-19 22:04:03 +00:00
}
2024-03-07 19:29:50 +00:00
func TestCanFrameWslMotorBackemf(t *testing.T) {
v := &WslMotorBackemf{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
}
2023-05-19 22:04:03 +00:00
func TestMarshalUnmarshalWsl15165VoltageRail(t *testing.T) {
v := &Wsl15165VoltageRail{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsl15165VoltageRail(t *testing.T) {
v := &Wsl15165VoltageRail{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *Wsl15165VoltageRail:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsl15165VoltageRail(t *testing.T) {
v := &Wsl15165VoltageRail{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWsl2512VoltageRail(t *testing.T) {
v := &Wsl2512VoltageRail{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWsl2512VoltageRail(t *testing.T) {
v := &Wsl2512VoltageRail{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *Wsl2512VoltageRail:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWsl2512VoltageRail(t *testing.T) {
v := &Wsl2512VoltageRail{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslHeatsinkMotorTemp(t *testing.T) {
v := &WslHeatsinkMotorTemp{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslHeatsinkMotorTemp(t *testing.T) {
v := &WslHeatsinkMotorTemp{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslHeatsinkMotorTemp:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslHeatsinkMotorTemp(t *testing.T) {
v := &WslHeatsinkMotorTemp{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslDspBoardTemp(t *testing.T) {
v := &WslDspBoardTemp{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslDspBoardTemp(t *testing.T) {
v := &WslDspBoardTemp{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslDspBoardTemp:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslDspBoardTemp(t *testing.T) {
v := &WslDspBoardTemp{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslOdometerBusAmphoursMeasurement(t *testing.T) {
v := &WslOdometerBusAmphoursMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslOdometerBusAmphoursMeasurement(t *testing.T) {
v := &WslOdometerBusAmphoursMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslOdometerBusAmphoursMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslOdometerBusAmphoursMeasurement(t *testing.T) {
v := &WslOdometerBusAmphoursMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslReserved(t *testing.T) {
v := &WslReserved{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslReserved(t *testing.T) {
v := &WslReserved{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslReserved:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslReserved(t *testing.T) {
v := &WslReserved{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}
func TestMarshalUnmarshalWslSlipSpeedMeasurement(t *testing.T) {
v := &WslSlipSpeedMeasurement{}
bin, err := v.MarshalPacket()
if err != nil {
t.Fatal(err)
}
err = v.UnmarshalPacket(bin)
if err != nil {
t.Fatal(err)
}
}
func TestJSONWslSlipSpeedMeasurement(t *testing.T) {
v := &WslSlipSpeedMeasurement{}
2023-05-29 00:39:03 +00:00
rawData, err := json.Marshal(v)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
2024-02-28 07:07:28 +00:00
p, err := FromJson(v.String(), rawData)
2023-05-19 22:04:03 +00:00
if err != nil {
t.Fatal(err)
}
switch underlying := p.(type) {
case *WslSlipSpeedMeasurement:
break
default:
t.Fatalf("didn't match type: %T, %v", underlying, underlying)
}
2024-03-07 19:29:50 +00:00
}
func TestCanFrameWslSlipSpeedMeasurement(t *testing.T) {
v := &WslSlipSpeedMeasurement{}
frame, err := ToCanFrame(v)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
2023-05-19 22:04:03 +00:00
2024-03-07 19:29:50 +00:00
retpkt, err := FromCanFrame(frame)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
if !reflect.DeepEqual(v, retpkt) {
t.Fatalf("decoded packet did not match sent %v got %v", v, retpkt)
}
2023-05-19 22:04:03 +00:00
}