- Clean up test code
authorjw_wonny.cha <jw_wonny.cha@samsung.com>
Fri, 29 Mar 2019 06:06:03 +0000 (15:06 +0900)
committerjw_wonny.cha <jw_wonny.cha@samsung.com>
Fri, 29 Mar 2019 06:06:03 +0000 (15:06 +0900)
src/servicemgr/common_test.go [new file with mode: 0644]
src/servicemgr/servicemgr_test.go

diff --git a/src/servicemgr/common_test.go b/src/servicemgr/common_test.go
new file mode 100644 (file)
index 0000000..e1e4b4f
--- /dev/null
@@ -0,0 +1,27 @@
+package servicemgr
+
+import (
+       "strings"
+       "testing"
+)
+
+
+const (
+       serviceName  = "ls"
+       serviceName2 = "main2"
+)
+
+func assertEqualStr(t *testing.T, a, b string) {
+       t.Helper()
+       if strings.Compare(a, b) != 0 {
+               t.Errorf("%s != %s", a, b)
+       }
+}
+
+func retError(t *testing.T, err error) {
+       t.Helper()
+
+       if err != nil {
+               t.Error(err.Error())
+       }
+}
index c01c21ffe12ac840474b3879a2a978a869ee5226..56db3100396c75684ef3895e08ec3f1a08f1def5 100644 (file)
@@ -12,21 +12,8 @@ var (
        serviceID       uint64
 )
 
-const (
-       serviceName  = "ls"
-       serviceName2 = "main2"
-)
-
 func init() {
-       InitServiceMap()
-}
-
-func retError(t *testing.T, err error) {
-       t.Helper()
-
-       if err != nil {
-               t.Error(err.Error())
-       }
+       Init()
 }
 
 func TestExecuteApp(t *testing.T) {
@@ -55,8 +42,8 @@ func TestHandleNoti(t *testing.T) {
        retError(t, err)
 
        statusNotificationRequest := make(map[string]interface{})
-       statusNotificationRequest["ServiceID"] = id
-       statusNotificationRequest["Status"] = ConstServiceStatusFinished
+       statusNotificationRequest[ConstKeyServiceID] = id
+       statusNotificationRequest[ConstKeyStatus] = ConstServiceStatusFinished
 
        HandleNoti(statusNotificationRequest)