mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 18:46:24 +05:00
last usage test fixes
This commit is contained in:
@@ -258,7 +258,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
if maxUsage != 1.048576e+06 {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
eAcntVal = 49997849600.000000 // 20480
|
||||
eAcntVal = 49998883840.000000 // 20480
|
||||
if err := smgRPC.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
@@ -285,7 +285,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
if maxUsage != 1.048576e+06 {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
eAcntVal = 49997829120.000000 // 20480
|
||||
eAcntVal = 49998863360.000000 // 20480
|
||||
if err := smgRPC.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
@@ -311,7 +311,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
if maxUsage != 1.048576e+06 {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
eAcntVal = 49996774400.000000 // 1054720
|
||||
eAcntVal = 49998842880.000000 // 20480
|
||||
if err := smgRPC.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
|
||||
@@ -96,6 +96,7 @@ func (self *SMGSession) debit(dur time.Duration, lastUsed time.Duration) (time.D
|
||||
return ccDuration, nil
|
||||
}
|
||||
//utils.Logger.Debug(fmt.Sprintf("dur: %f", dur.Seconds()))
|
||||
initialExtraDuration := self.extraDuration
|
||||
self.extraDuration = 0
|
||||
if self.cd.LoopIndex > 0 {
|
||||
self.cd.TimeStart = self.cd.TimeEnd
|
||||
@@ -111,7 +112,6 @@ func (self *SMGSession) debit(dur time.Duration, lastUsed time.Duration) (time.D
|
||||
self.cd.TimeEnd = cc.GetEndTime() // set debited timeEnd
|
||||
// update call duration with real debited duration
|
||||
ccDuration := cc.GetDuration()
|
||||
initialExtraDuration := self.extraDuration
|
||||
if ccDuration != dur {
|
||||
self.extraDuration = ccDuration - dur
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user