From b114f5626ec94b27c26ba075d0c0b68743aff36c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 25 Oct 2014 00:36:50 +0100 Subject: Add request drip rate to assertions for token bucket regression tests --- .../ClientStack/Linden/UDP/Tests/ThrottleTests.cs | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs index cd87928..0d39c1d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs @@ -58,29 +58,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests public void TestSetRequestDripRate() { TokenBucket tb = new TokenBucket("tb", null, 5000, 0); - AssertRates(tb, 5000, 5000, 0); + AssertRates(tb, 5000, 5000, 5000, 0); tb.RequestedDripRate = 4000; - AssertRates(tb, 4000, 4000, 0); + AssertRates(tb, 4000, 4000, 4000, 0); tb.RequestedDripRate = 6000; - AssertRates(tb, 6000, 6000, 0); + AssertRates(tb, 6000, 6000, 6000, 0); } [Test] public void TestSetRequestDripRateWithMax() { TokenBucket tb = new TokenBucket("tb", null, 5000, 10000); - AssertRates(tb, 5000, 5000, 10000); + AssertRates(tb, 5000, 5000, 5000, 10000); tb.RequestedDripRate = 4000; - AssertRates(tb, 4000, 4000, 10000); + AssertRates(tb, 4000, 4000, 4000, 10000); tb.RequestedDripRate = 6000; - AssertRates(tb, 6000, 6000, 10000); + AssertRates(tb, 6000, 6000, 6000, 10000); tb.RequestedDripRate = 12000; - AssertRates(tb, 10000, 10000, 10000); + AssertRates(tb, 10000, 10000, 10000, 10000); } [Test] @@ -90,15 +90,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests TokenBucket tbChild1 = new TokenBucket("tbChild1", tbParent, 3000, 0); TokenBucket tbChild2 = new TokenBucket("tbChild2", tbParent, 5000, 0); - AssertRates(tbParent, 8000, 8000, 0); - AssertRates(tbChild1, 3000, 3000, 0); - AssertRates(tbChild2, 5000, 5000, 0); + AssertRates(tbParent, 8000, 8000, 8000, 0); + AssertRates(tbChild1, 3000, 3000, 3000, 0); + AssertRates(tbChild2, 5000, 5000, 5000, 0); } - private void AssertRates(TokenBucket tb, double dripRate, double totalDripRequest, double maxDripRate) + private void AssertRates( + TokenBucket tb, double requestedDripRate, double totalDripRequest, double dripRate, double maxDripRate) { - Assert.AreEqual((int)dripRate, tb.DripRate); + Assert.AreEqual((int)requestedDripRate, tb.RequestedDripRate); Assert.AreEqual((int)totalDripRequest, tb.TotalDripRequest); + Assert.AreEqual((int)dripRate, tb.DripRate); Assert.AreEqual((int)maxDripRate, tb.MaxDripRate); } -- cgit v1.1