rts-sim-testing-service/third_party/electrical_machinery/electrical_machinery_test.go

26 lines
517 B
Go
Raw Normal View History

2024-04-19 16:55:51 +08:00
package electrical_machinery
import (
"fmt"
"joylink.club/bj-rtsts-server/third_party/message"
"joylink.club/bj-rtsts-server/third_party/udp"
"testing"
2024-04-28 11:01:12 +08:00
"time"
2024-04-19 16:55:51 +08:00
)
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)
}
2024-04-28 11:01:12 +08:00
func TestOther(t *testing.T) {
dd := 1714024680 - time.Now().Unix()
fmt.Println(dd)
fmt.Println(int32(dd))
}