Code Review
/
ric-plt
/
submgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Restored UT cases + reduced UT run time
[ric-plt/submgr.git]
/
pkg
/
control
/
sdl_test.go
diff --git
a/pkg/control/sdl_test.go
b/pkg/control/sdl_test.go
index
6b3ca0b
..
2fac9b2
100644
(file)
--- a/
pkg/control/sdl_test.go
+++ b/
pkg/control/sdl_test.go
@@
-22,15
+22,17
@@
package control
import (
"encoding/json"
"fmt"
import (
"encoding/json"
"fmt"
- "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
- "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
- "github.com/stretchr/testify/assert"
"reflect"
"strconv"
"strings"
"reflect"
"strconv"
"strings"
+ "sync"
"testing"
"time"
"testing"
"time"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
+ "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+ "github.com/stretchr/testify/assert"
)
var sdlShouldReturnError bool = false
)
var sdlShouldReturnError bool = false
@@
-48,6
+50,7
@@
type Mock struct {
register map[uint32]*Subscription
subIds []uint32
lastAllocatedSubId uint32
register map[uint32]*Subscription
subIds []uint32
lastAllocatedSubId uint32
+ marshalLock sync.Mutex
}
var mock *Mock
}
var mock *Mock
@@
-464,6
+467,9
@@
func (m *Mock) Set(pairs ...interface{}) error {
var key string
var val string
var key string
var val string
+ m.marshalLock.Lock()
+ defer m.marshalLock.Unlock()
+
if sdlShouldReturnError == true {
return GetSdlError()
}
if sdlShouldReturnError == true {
return GetSdlError()
}