Fixed CompressFactor check for comparing

This commit is contained in:
porosnicuadrian
2021-05-05 17:14:46 +03:00
committed by Dan Christian Bogos
parent c003c8eab4
commit 95d4a6cd96
2 changed files with 1 additions and 14 deletions

View File

@@ -459,7 +459,7 @@ func (rIl *RateSInterval) Equals(nRil *RateSInterval) (eq bool) {
}
}
}
return true
return rIl.CompressFactor == nRil.CompressFactor
}
// Equals returns the equality between two RateSIncrement

View File

@@ -1696,19 +1696,6 @@ func TestRatesIncrementEquals(t *testing.T) {
}
incr2.IntervalRateIndex = 1
//not equals by RateUID
incr1.Rate.uID = "changed_uID"
if incr1.Equals(incr2) {
t.Errorf("Intervals %+v and %+v are equal", ToJSON(incr1), ToJSON(incr2))
}
incr1.Rate.uID = "newID"
incr2.Rate.uID = "changed_uID"
if incr1.Equals(incr2) {
t.Errorf("Intervals %+v and %+v are equal", ToJSON(incr1), ToJSON(incr2))
}
incr2.Rate.uID = "newID"
// not equals by CompressFactor
incr1.CompressFactor = 0
if incr1.Equals(incr2) {