mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 13:19:53 +05:00
Fixed panic for ping methods in dispatchers
This commit is contained in:
committed by
Dan Christian Bogos
parent
d58e231beb
commit
fe506d48d4
@@ -224,7 +224,10 @@ type CGREvents struct {
|
||||
}
|
||||
|
||||
func NewCGREventWithArgDispatcher() *CGREventWithArgDispatcher {
|
||||
return new(CGREventWithArgDispatcher)
|
||||
return &CGREventWithArgDispatcher{
|
||||
CGREvent: new(CGREvent),
|
||||
ArgDispatcher: new(ArgDispatcher),
|
||||
}
|
||||
}
|
||||
|
||||
type CGREventWithArgDispatcher struct {
|
||||
|
||||
@@ -447,11 +447,14 @@ func TestCGREventConsumeArgs(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewCGREventWithArgDispatcher(t *testing.T) {
|
||||
eOut := new(CGREventWithArgDispatcher)
|
||||
rcv := NewCGREventWithArgDispatcher()
|
||||
exp := &CGREventWithArgDispatcher{
|
||||
CGREvent: new(CGREvent),
|
||||
ArgDispatcher: new(ArgDispatcher),
|
||||
}
|
||||
eOut := NewCGREventWithArgDispatcher()
|
||||
|
||||
if !reflect.DeepEqual(eOut, rcv) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
|
||||
if !reflect.DeepEqual(eOut, exp) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", eOut, exp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user