mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
cleanup unnecessary use of floats
This commit is contained in:
@@ -17,7 +17,7 @@ func TestHTTPServerFromRegistry(t *testing.T) {
|
||||
Id: "test",
|
||||
Type: "http.server",
|
||||
Params: map[string]any{
|
||||
"port": 3000.0,
|
||||
"port": 3000,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestSerialClientFromRegistry(t *testing.T) {
|
||||
Params: map[string]any{
|
||||
"port": "/dev/ttyUSB0",
|
||||
"framing": "LF",
|
||||
"baudRate": 9600.0,
|
||||
"baudRate": 9600,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ func TestTCPClientFromRegistry(t *testing.T) {
|
||||
Type: "net.tcp.client",
|
||||
Params: map[string]any{
|
||||
"host": "localhost",
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": "LF",
|
||||
},
|
||||
})
|
||||
@@ -60,7 +60,7 @@ func TestBadTCPClient(t *testing.T) {
|
||||
{
|
||||
name: "no host param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.tcp.client host error: not found",
|
||||
},
|
||||
@@ -68,7 +68,7 @@ func TestBadTCPClient(t *testing.T) {
|
||||
name: "non-string host param",
|
||||
params: map[string]any{
|
||||
"host": 123,
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.tcp.client host error: not a string",
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestTCPServerFromRegistry(t *testing.T) {
|
||||
Id: "test",
|
||||
Type: "net.tcp.server",
|
||||
Params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": "LF",
|
||||
},
|
||||
})
|
||||
@@ -59,14 +59,14 @@ func TestBadTCPServer(t *testing.T) {
|
||||
{
|
||||
name: "no framing param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.tcp.server framing error: not found",
|
||||
},
|
||||
{
|
||||
name: "non-string framing param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": 1,
|
||||
},
|
||||
errorString: "net.tcp.server framing error: not a string",
|
||||
@@ -74,7 +74,7 @@ func TestBadTCPServer(t *testing.T) {
|
||||
{
|
||||
name: "unkown framing method",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": "asdfasdfasdfasdflkj",
|
||||
},
|
||||
errorString: "net.tcp.server unknown framing method: asdfasdfasdfasdflkj",
|
||||
@@ -82,7 +82,7 @@ func TestBadTCPServer(t *testing.T) {
|
||||
{
|
||||
name: "non-string ip param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": "LF",
|
||||
"ip": 123,
|
||||
},
|
||||
@@ -92,7 +92,7 @@ func TestBadTCPServer(t *testing.T) {
|
||||
name: "invalid addr",
|
||||
params: map[string]any{
|
||||
"ip": "127.0.0.",
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": "LF",
|
||||
},
|
||||
errorString: "lookup 127.0.0.: no such host",
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestTimeIntervalFromRegistry(t *testing.T) {
|
||||
Id: "test",
|
||||
Type: "time.interval",
|
||||
Params: map[string]any{
|
||||
"duration": 1000.0,
|
||||
"duration": 1000,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestTimeTimerFromRegistry(t *testing.T) {
|
||||
Id: "test",
|
||||
Type: "time.timer",
|
||||
Params: map[string]any{
|
||||
"duration": 1000.0,
|
||||
"duration": 1000,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ func TestUDPClientFromRegistry(t *testing.T) {
|
||||
Type: "net.udp.client",
|
||||
Params: map[string]any{
|
||||
"host": "localhost",
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"framing": "LF",
|
||||
},
|
||||
})
|
||||
@@ -60,7 +60,7 @@ func TestBadUDPClient(t *testing.T) {
|
||||
{
|
||||
name: "no host param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.udp.client host error: not found",
|
||||
},
|
||||
@@ -68,7 +68,7 @@ func TestBadUDPClient(t *testing.T) {
|
||||
name: "non-string host param",
|
||||
params: map[string]any{
|
||||
"host": 123,
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.udp.client host error: not a string",
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ func TestUDPMulticastFromRegistry(t *testing.T) {
|
||||
Type: "net.udp.multicast",
|
||||
Params: map[string]any{
|
||||
"ip": "236.10.10.10",
|
||||
"port": 56565.0,
|
||||
"port": 56565,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -59,7 +59,7 @@ func TestBadUDPMulticast(t *testing.T) {
|
||||
{
|
||||
name: "no ip param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.udp.multicast ip error: not found",
|
||||
},
|
||||
@@ -67,7 +67,7 @@ func TestBadUDPMulticast(t *testing.T) {
|
||||
name: "non-string ip param",
|
||||
params: map[string]any{
|
||||
"ip": 123,
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "net.udp.multicast ip error: not a string",
|
||||
},
|
||||
@@ -75,7 +75,7 @@ func TestBadUDPMulticast(t *testing.T) {
|
||||
name: "invalid addr",
|
||||
params: map[string]any{
|
||||
"ip": "127.0.0.",
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "lookup 127.0.0.: no such host",
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestUDPServerFromRegistry(t *testing.T) {
|
||||
Id: "test",
|
||||
Type: "net.udp.server",
|
||||
Params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -55,7 +55,7 @@ func TestBadUDPServer(t *testing.T) {
|
||||
{
|
||||
name: "non-string ip param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"ip": 123,
|
||||
},
|
||||
errorString: "net.udp.server ip error: not a string",
|
||||
@@ -63,7 +63,7 @@ func TestBadUDPServer(t *testing.T) {
|
||||
{
|
||||
name: "non-number bufferSize param",
|
||||
params: map[string]any{
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
"bufferSize": "1024",
|
||||
},
|
||||
errorString: "net.udp.server bufferSize error: not a number",
|
||||
@@ -72,7 +72,7 @@ func TestBadUDPServer(t *testing.T) {
|
||||
name: "invalid addr",
|
||||
params: map[string]any{
|
||||
"ip": "127.0.0.",
|
||||
"port": 8000.0,
|
||||
"port": 8000,
|
||||
},
|
||||
errorString: "lookup 127.0.0.: no such host",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user