MCPcopy Create free account
hub / github.com/facebook/time / TestEncode1033RoundTrip

Function TestEncode1033RoundTrip

rtcm/encode_test.go:30–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestEncode1033RoundTrip(t *testing.T) {
31 desc := AntennaDescriptor{
32 StationID: 1234,
33 AntennaType: "ADVNULLANTENNA",
34 ReceiverType: "u-blox F9T",
35 ReceiverFW: "2.20",
36 }
37 frame := Encode1033(desc)
38
39 f, err := ParseFrame(frame) // also validates CRC-24Q
40 require.NoError(t, err)
41 require.Equal(t, uint16(1033), f.MessageType)
42 require.Equal(t, uint16(1234), stationIDOf(f.Payload))
43 require.Contains(t, string(f.Payload), "ADVNULLANTENNA")
44 require.Contains(t, string(f.Payload), "u-blox F9T")
45 require.Contains(t, string(f.Payload), "2.20")
46}
47
48func TestPatchStationID(t *testing.T) {
49 orig := Encode1033(AntennaDescriptor{StationID: 1, AntennaType: "X"})

Callers

nothing calls this directly

Calls 3

Encode1033Function · 0.85
ParseFrameFunction · 0.85
stationIDOfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…