From 881557ba91bae5ec5cc6eeb6918fc42ea93866ab Mon Sep 17 00:00:00 2001 From: DanB Date: Sun, 21 May 2017 21:04:47 +0200 Subject: [PATCH] Test fixes --- engine/calldesc.go | 1 + engine/calldesc_test.go | 3 ++- engine/eventcost.go | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/calldesc.go b/engine/calldesc.go index 2107b3525..6451bf4ae 100644 --- a/engine/calldesc.go +++ b/engine/calldesc.go @@ -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 diff --git a/engine/calldesc_test.go b/engine/calldesc_test.go index 3ebdaf242..2c3cb530e 100644 --- a/engine/calldesc_test.go +++ b/engine/calldesc_test.go @@ -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") diff --git a/engine/eventcost.go b/engine/eventcost.go index 0168c11bd..319229091 100644 --- a/engine/eventcost.go +++ b/engine/eventcost.go @@ -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