(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestReadHeaderStruct(t *testing.T) { |
| 301 | byteData := []byte{ |
| 302 | 0x00, 0x00, 0x00, 0x01, // UTC/local |
| 303 | 0x00, 0x00, 0x00, 0x02, // standard/wall |
| 304 | 0x00, 0x00, 0x00, 0x03, // leap |
| 305 | 0x00, 0x00, 0x00, 0x04, // transition |
| 306 | 0x00, 0x00, 0x00, 0x05, // local tz |
| 307 | 0x00, 0x00, 0x00, 0x06, // characters |
| 308 | 0x04, 0xb2, 0x58, 0x00, // leap time |
| 309 | 0x00, 0x00, 0x00, 0x01, // leap count |
| 310 | } |
| 311 | |
| 312 | r := bytes.NewReader(byteData) |
| 313 | |
| 314 | var hdr Header |
| 315 | err := binary.Read(r, binary.BigEndian, &hdr) |
| 316 | require.NoError(t, err) |
| 317 | require.Equal(t, uint32(6), hdr.CharCnt, "wrong header - CharCnt") |
| 318 | require.Equal(t, uint32(5), hdr.TypeCnt, "wrong header - TypeCnt") |
| 319 | require.Equal(t, uint32(4), hdr.TimeCnt, "wrong header - TimeCnt") |
| 320 | require.Equal(t, uint32(3), hdr.LeapCnt, "wrong header - LeapCnt") |
| 321 | require.Equal(t, uint32(2), hdr.IsStdCnt, "wrong header - IsStdCnt") |
| 322 | require.Equal(t, uint32(1), hdr.IsUtcCnt, "wrong header - IsUtcCnt") |
| 323 | } |
| 324 | |
| 325 | func TestWriteV2(t *testing.T) { |
| 326 | byteData := []byte{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…