test for identical uuid in different account

This commit is contained in:
Radu Ioan Fericean
2015-09-18 14:28:30 +03:00
parent 116539c3e5
commit 4c7e6b7b77
2 changed files with 17 additions and 1 deletions

View File

@@ -192,6 +192,7 @@ CDRST2_WARN_ACD,,*min_acd,3,true,0,,,,,,,,,,,5,CDRST_WARN_HTTP,10
accountActions = `
vdf,minitsboy,*out,MORE_MINUTES,STANDARD_TRIGGER
cgrates.org,12345,*out,TOPUP10_AT,STANDARD_TRIGGERS
cgrates.org,123456,*out,TOPUP10_AT,STANDARD_TRIGGERS
cgrates.org,remo,*out,TOPUP10_AT,
vdf,empty0,*out,TOPUP_SHARED0_AT,
vdf,empty10,*out,TOPUP_SHARED10_AT,
@@ -1022,7 +1023,7 @@ func TestLoadActionTriggers(t *testing.T) {
}
func TestLoadAccountActions(t *testing.T) {
if len(csvr.accountActions) != 8 {
if len(csvr.accountActions) != 9 {
t.Error("Failed to load account actions: ", len(csvr.accountActions))
}
aa := csvr.accountActions["*out:vdf:minitsboy"]

View File

@@ -244,6 +244,21 @@ func TestStoreInterfaces(t *testing.T) {
var _ LogStorage = sql
}
func TestDifferentUuid(t *testing.T) {
a1, err := accountingStorage.GetAccount("*out:cgrates.org:12345")
if err != nil {
t.Error("Error getting account: ", err)
}
a2, err := accountingStorage.GetAccount("*out:cgrates.org:123456")
if err != nil {
t.Error("Error getting account: ", err)
}
if a1.BalanceMap[utils.VOICE+utils.OUT][0].Uuid == a2.BalanceMap[utils.VOICE+utils.OUT][0].Uuid ||
a1.BalanceMap[utils.MONETARY+utils.OUT][0].Uuid == a2.BalanceMap[utils.MONETARY+utils.OUT][0].Uuid {
t.Errorf("Identical uuids in different accounts: %+v <-> %+v", a1.BalanceMap[utils.VOICE+utils.OUT][0], a1.BalanceMap[utils.MONETARY+utils.OUT][0])
}
}
/************************** Benchmarks *****************************/
func GetUB() *Account {