mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 14:48:43 +05:00
SMGeneric using cloning for replication to avoid concurrency
This commit is contained in:
@@ -630,6 +630,15 @@ func TestClone(t *testing.T) {
|
||||
if b != a {
|
||||
t.Error("Expected:", a, ", received:", b)
|
||||
}
|
||||
// Clone from an interface
|
||||
c := "mystr"
|
||||
ifaceC := interface{}(c)
|
||||
clndIface := reflect.Indirect(reflect.New(reflect.TypeOf(ifaceC))).Interface().(string)
|
||||
if err := Clone(ifaceC, &clndIface); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(ifaceC, clndIface) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", ifaceC, clndIface)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIntPointer(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user