(b *testing.B)
| 338 | } |
| 339 | |
| 340 | func BenchmarkWriteSignaling(b *testing.B) { |
| 341 | p := &Signaling{ |
| 342 | Header: Header{ |
| 343 | SdoIDAndMsgType: NewSdoIDAndMsgType(MessageSignaling, 0), |
| 344 | Version: 2, |
| 345 | MessageLength: 56, |
| 346 | DomainNumber: 0, |
| 347 | MinorSdoID: 0, |
| 348 | FlagField: FlagUnicast | FlagTwoStep, |
| 349 | CorrectionField: 0, |
| 350 | MessageTypeSpecific: 0, |
| 351 | SourcePortIdentity: PortIdentity{ |
| 352 | PortNumber: 1, |
| 353 | ClockIdentity: 16437344792485782624, |
| 354 | }, |
| 355 | SequenceID: 7620, |
| 356 | ControlField: 5, |
| 357 | LogMessageInterval: 0x7f, |
| 358 | }, |
| 359 | TargetPortIdentity: PortIdentity{ |
| 360 | PortNumber: 1, |
| 361 | ClockIdentity: 5212879185253000328, |
| 362 | }, |
| 363 | TLVs: []TLV{ |
| 364 | &GrantUnicastTransmissionTLV{ |
| 365 | TLVHead: TLVHead{ |
| 366 | TLVType: TLVGrantUnicastTransmission, |
| 367 | LengthField: 8, |
| 368 | }, |
| 369 | MsgTypeAndReserved: NewUnicastMsgTypeAndFlags(MessageAnnounce, 0), |
| 370 | LogInterMessagePeriod: 1, |
| 371 | DurationField: 60, |
| 372 | Renewal: 1, |
| 373 | }, |
| 374 | }, |
| 375 | } |
| 376 | buf := make([]byte, 64) |
| 377 | for n := 0; n < b.N; n++ { |
| 378 | _, _ = BytesTo(p, buf) |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | func BenchmarkReadSignaling(b *testing.B) { |
| 383 | raw := []uint8{0x0c, 0x02, 0x00, 0x38, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, |
nothing calls this directly
no test coverage detected
searching dependent graphs…