fix init counters

This commit is contained in:
Radu Ioan Fericean
2015-11-03 18:21:23 +02:00
parent f115b69287
commit 233b4b0b4a
2 changed files with 2 additions and 2 deletions

View File

@@ -563,7 +563,7 @@ func (acc *Account) countUnits(amount float64, kind string, cc *CallCost, b *Bal
// Create counters for all triggered actions
func (acc *Account) InitCounters() {
acc.UnitCounters = make(UnitCounters, 0)
acc.UnitCounters = nil
ucTempMap := make(map[string]*UnitCounter)
for _, at := range acc.ActionTriggers {
if !strings.Contains(at.ThresholdType, "counter") {

View File

@@ -67,7 +67,7 @@ ENABLE_ACNT,*enable_account,,,,,,,,,,,,,false,10`
t.Error(err)
} else if acnt == nil {
t.Error("No account created")
} else if !reflect.DeepEqual(expectAcnt, acnt) {
} else if !reflect.DeepEqual(expectAcnt.ActionTriggers, acnt.ActionTriggers) {
t.Errorf("Expecting: %+v, received: %+v", expectAcnt, acnt)
}
}