rts-sim-testing-service/third_party/electrical_machinery/electrical_machinery_test.go
2024-04-28 11:01:12 +08:00

26 lines
517 B
Go

package electrical_machinery
import (
"fmt"
"joylink.club/bj-rtsts-server/third_party/message"
"joylink.club/bj-rtsts-server/third_party/udp"
"testing"
"time"
)
func TestServer(t *testing.T) {
udpServer := udp.NewServer(fmt.Sprintf("127.0.0.1:%d", 9999), handleCanetFrames)
udpServer.Listen()
select {}
}
func handleCanetFrames(d []byte) {
msg := &message.ElectricMachinery{}
msg.Decode(d)
}
func TestOther(t *testing.T) {
dd := 1714024680 - time.Now().Unix()
fmt.Println(dd)
fmt.Println(int32(dd))
}