mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
banchmarking in place
This commit is contained in:
@@ -26,9 +26,9 @@ func NewStorage(nsg timeslots.StorageGetter) *Storage{
|
||||
/*
|
||||
RPC method providing the rating information from the storage.
|
||||
*/
|
||||
func (s *Storage) GetCost(in *timeslots.CallDescription, reply *CallCost) (error) {
|
||||
func (s *Storage) GetCost(in *timeslots.CallDescription, reply *timeslots.CallCost) (err error) {
|
||||
r, e := timeslots.GetCost(in, s.sg)
|
||||
*replay, err = r, e
|
||||
*reply, err = *r, e
|
||||
return e
|
||||
}
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ type CallDescription struct {
|
||||
|
||||
type CallCost struct {
|
||||
TOR int
|
||||
CstmId, Subjext, Prefix string
|
||||
CstmId, Subject, Prefix string
|
||||
Cost, ConnectFee float32
|
||||
// ratesInfo *RatingProfile
|
||||
}
|
||||
|
||||
func GetCost(in *CallDescription, sg StorageGetter) (result *CallCost, err error) {
|
||||
return &CallCost{TOR: 1, CstmId:"",Subjext:"",Prefix:"", Cost:1, ConnectFee:1}, nil
|
||||
return &CallCost{TOR: 1, CstmId:"",Subject:"", Prefix:"", Cost:1, ConnectFee:1}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ func TestSimple(t *testing.T){
|
||||
if err != nil {
|
||||
t.Error("Got error on getting cost")
|
||||
}
|
||||
expected:= &CallCost{TOR: 1, CstmId:"",Subjext:"",Prefix:"", Cost:1, ConnectFee:1}
|
||||
expected:= &CallCost{TOR: 1, CstmId:"",Subject:"",Prefix:"", Cost:1, ConnectFee:1}
|
||||
if *cc != *expected {
|
||||
t.Errorf("Expected %v got %v", expected, cc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user