Test fixes

This commit is contained in:
DanB
2017-05-21 21:04:47 +02:00
parent 952c817f86
commit 881557ba91
3 changed files with 3 additions and 4 deletions

View File

@@ -713,6 +713,7 @@ func (cd *CallDescriptor) Debit() (cc *CallCost, err error) {
}
_, err = guardian.Guardian.Guard(func() (iface interface{}, err error) {
cc, err = cd.debit(account, cd.DryRun, !cd.DenyNegativeAccount)
cc.AccountSummary = cd.AccountSummary()
return
}, 0, lkIDs...)
return

View File

@@ -1316,7 +1316,8 @@ func TestDebitAndMaxDebit(t *testing.T) {
// make Unit.Values have the same value
cc1.Timespans[0].Increments[0].BalanceInfo.Unit.Value = 0
cc2.Timespans[0].Increments[0].BalanceInfo.Unit.Value = 0
if !reflect.DeepEqual(cc1, cc2) {
cc1.AccountSummary, cc2.AccountSummary = nil, nil // account changes, enforce here emptying the info so reflect can pass
if !reflect.DeepEqual(cc1.Timespans, cc2.Timespans) {
t.Log("CC1: ", utils.ToIJSON(cc1))
t.Log("CC2: ", utils.ToIJSON(cc2))
t.Error("Debit and MaxDebit differ")

View File

@@ -354,9 +354,6 @@ func (cIl *ChargingInterval) GetCost() float64 {
var cost float64
for _, incr := range cIl.Increments {
cost += incr.Cost * float64(incr.CompressFactor)
}
if cIl.RoundingIncrement != nil {
}
cost = utils.Round(cost, globalRoundingDecimals, utils.ROUNDING_MIDDLE)
cIl.Cost = &cost