From 34d27b75c9a442d319260f3eae61d3087cc51258 Mon Sep 17 00:00:00 2001 From: Radhi Fadlillah Date: Mon, 22 May 2017 22:34:03 +0700 Subject: [PATCH] Rename variable for testing --- device_test.go | 14 +++++--------- utils.go | 4 ++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/device_test.go b/device_test.go index 1e31c78..61be191 100644 --- a/device_test.go +++ b/device_test.go @@ -6,14 +6,10 @@ import ( "testing" ) -var defaultDevice = Device{ - XAddr: "http://192.168.1.75:5000/onvif/device_service", -} - func TestGetInformation(t *testing.T) { log.Println("Test GetInformation") - res, err := defaultDevice.GetInformation() + res, err := testDevice.GetInformation() if err != nil { t.Error(err) } @@ -25,7 +21,7 @@ func TestGetInformation(t *testing.T) { func TestGetCapabilities(t *testing.T) { log.Println("Test GetCapabilities") - res, err := defaultDevice.GetCapabilities() + res, err := testDevice.GetCapabilities() if err != nil { t.Error(err) } @@ -37,7 +33,7 @@ func TestGetCapabilities(t *testing.T) { func TestGetDiscoveryMode(t *testing.T) { log.Println("Test GetDiscoveryMode") - res, err := defaultDevice.GetDiscoveryMode() + res, err := testDevice.GetDiscoveryMode() if err != nil { t.Error(err) } @@ -48,7 +44,7 @@ func TestGetDiscoveryMode(t *testing.T) { func TestGetScopes(t *testing.T) { log.Println("Test GetScopes") - res, err := defaultDevice.GetScopes() + res, err := testDevice.GetScopes() if err != nil { t.Error(err) } @@ -60,7 +56,7 @@ func TestGetScopes(t *testing.T) { func TestGetHostname(t *testing.T) { log.Println("Test GetHostname") - res, err := defaultDevice.GetHostname() + res, err := testDevice.GetHostname() if err != nil { t.Error(err) } diff --git a/utils.go b/utils.go index e02fea3..e6677ea 100644 --- a/utils.go +++ b/utils.go @@ -5,6 +5,10 @@ import ( "strings" ) +var testDevice = Device{ + XAddr: "http://192.168.1.75:5000/onvif/device_service", +} + func interfaceToString(src interface{}) string { str, _ := src.(string) return str