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

Function Test_byteToTime

timestamp/timestamp_notlinux_test.go:31–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29)
30
31func Test_byteToTime(t *testing.T) {
32 timeb := []byte{145, 131, 229, 97, 0, 0, 0, 0, 203, 178, 14, 0, 0, 0, 0, 0}
33 res, err := byteToTime(timeb)
34 require.Nil(t, err)
35
36 tv := &unix.Timeval{Sec: 1642431377, Usec: 963275}
37 require.Equal(t, time.Unix(tv.Unix()).UnixNano(), res.UnixNano())
38}
39
40func TestEnableSWTimestampsRx(t *testing.T) {
41 // listen to incoming udp packets

Callers

nothing calls this directly

Calls 2

UnixMethod · 0.80
byteToTimeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…