Massive tab and trailing space cleanup

This commit is contained in:
Melanie Thielker
2017-01-05 19:07:37 +00:00
parent e88e2945e9
commit b16abc8166
959 changed files with 23646 additions and 23646 deletions

View File

@@ -70,7 +70,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
m_scene = new SceneHelpers().SetupScene();
StatsManager.SimExtraStats = new SimExtraStatsCollector();
}
// /// <summary>
// /// Build an object name packet for test purposes
// /// </summary>
@@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// odb.Name = Utils.StringToBytes(objectName);
// onp.ObjectData = new ObjectNamePacket.ObjectDataBlock[] { odb };
// onp.Header.Zerocoded = false;
//
//
// return onp;
// }
//
@@ -156,7 +156,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
config.Set("AckTimeout", -1);
TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(m_scene, ics);
ScenePresence sp
ScenePresence sp
= ClientStackHelpers.AddChildClient(
m_scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
@@ -175,21 +175,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// TestHelper.InMethod();
//
// uint myCircuitCode = 123457;
//
//
// TestLLUDPServer testLLUDPServer;
// TestLLPacketServer testLLPacketServer;
// AgentCircuitManager acm;
// SetupStack(new MockScene(), out testLLUDPServer, out testLLPacketServer, out acm);
// AddClient(myCircuitCode, new IPEndPoint(IPAddress.Loopback, 1000), testLLUDPServer, acm);
//
//
// testLLUDPServer.RemoveClientCircuit(myCircuitCode);
// Assert.IsFalse(testLLUDPServer.HasCircuit(myCircuitCode));
//
//
// // Check that removing a non-existent circuit doesn't have any bad effects
// testLLUDPServer.RemoveClientCircuit(101);
// Assert.IsFalse(testLLUDPServer.HasCircuit(101));
// }
//
//
// /// <summary>
// /// Make sure that the client stack reacts okay to malformed packets
// /// </summary>
@@ -200,8 +200,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
//
// uint myCircuitCode = 123458;
// EndPoint testEp = new IPEndPoint(IPAddress.Loopback, 1001);
// MockScene scene = new MockScene();
//
// MockScene scene = new MockScene();
//
// TestLLUDPServer testLLUDPServer;
// TestLLPacketServer testLLPacketServer;
// AgentCircuitManager acm;
@@ -213,24 +213,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// // Send two garbled 'packets' in succession
// testLLUDPServer.LoadReceive(data, testEp);
// testLLUDPServer.LoadReceive(data, testEp);
// testLLUDPServer.ReceiveData(null);
//
// testLLUDPServer.ReceiveData(null);
//
// // Check that we are still here
// Assert.IsTrue(testLLUDPServer.HasCircuit(myCircuitCode));
// Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(0));
//
//
// // Check that sending a valid packet to same circuit still succeeds
// Assert.That(scene.ObjectNameCallsReceived, Is.EqualTo(0));
//
//
// testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "helloooo"), testEp);
// testLLUDPServer.ReceiveData(null);
//
//
// Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(1));
// Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(1));
// }
//
//
// /// <summary>
// /// Test that the stack continues to work even if some client has caused a
// /// Test that the stack continues to work even if some client has caused a
// /// SocketException on Socket.BeginReceive()
// /// </summary>
// [Test]
@@ -239,32 +239,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// TestHelper.InMethod();
//
// MockScene scene = new MockScene();
//
//
// uint circuitCodeA = 130000;
// EndPoint epA = new IPEndPoint(IPAddress.Loopback, 1300);
// UUID agentIdA = UUID.Parse("00000000-0000-0000-0000-000000001300");
// UUID sessionIdA = UUID.Parse("00000000-0000-0000-0000-000000002300");
//
//
// uint circuitCodeB = 130001;
// EndPoint epB = new IPEndPoint(IPAddress.Loopback, 1301);
// UUID agentIdB = UUID.Parse("00000000-0000-0000-0000-000000001301");
// UUID sessionIdB = UUID.Parse("00000000-0000-0000-0000-000000002301");
//
//
// TestLLUDPServer testLLUDPServer;
// TestLLPacketServer testLLPacketServer;
// AgentCircuitManager acm;
// SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
// AddClient(circuitCodeA, epA, agentIdA, sessionIdA, testLLUDPServer, acm);
// AddClient(circuitCodeB, epB, agentIdB, sessionIdB, testLLUDPServer, acm);
//
//
// testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet1"), epA);
// testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(1, "packet2"), epB);
// testLLUDPServer.LoadReceiveWithBeginException(epA);
// testLLUDPServer.LoadReceive(BuildTestObjectNamePacket(2, "packet3"), epB);
// testLLUDPServer.ReceiveData(null);
//
//
// Assert.IsFalse(testLLUDPServer.HasCircuit(circuitCodeA));
//
//
// Assert.That(testLLPacketServer.GetTotalPacketsReceived(), Is.EqualTo(3));
// Assert.That(testLLPacketServer.GetPacketsReceivedFor(PacketType.ObjectName), Is.EqualTo(3));
// }

View File

@@ -59,7 +59,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// agent.InventoryFolder = UUID.Zero;
// agent.startpos = Vector3.Zero;
// agent.CapsPath = "http://wibble.com";
//
//
// TestLLUDPServer testLLUDPServer;
// TestLLPacketServer testLLPacketServer;
// AgentCircuitManager acm;
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// SetupStack(scene, out testLLUDPServer, out testLLPacketServer, out acm);
//
// TestClient testClient = new TestClient(agent, scene);
//
//
// LLPacketHandler packetHandler
// = new LLPacketHandler(testClient, testLLPacketServer, new ClientStackUserSettings());
//
@@ -87,14 +87,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
// /// <param name="testPacketServer"></param>
// /// <param name="acm">Agent circuit manager used in setting up the stack</param>
// protected void SetupStack(
// IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer,
// IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer,
// out AgentCircuitManager acm)
// {
// IConfigSource configSource = new IniConfigSource();
// ClientStackUserSettings userSettings = new ClientStackUserSettings();
// testLLUDPServer = new TestLLUDPServer();
// acm = new AgentCircuitManager();
//
//
// uint port = 666;
// testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm);
// testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings);

View File

@@ -137,7 +137,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
Scene scene = new SceneHelpers().SetupScene();
TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene);
ScenePresence sp
ScenePresence sp
= ClientStackHelpers.AddChildClient(
scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
@@ -145,7 +145,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpServer.Throttle.DebugLevel = 1;
udpClient.ThrottleDebugLevel = 1;
int resendBytes = 1000;
int landBytes = 2000;
int windBytes = 3000;
@@ -161,8 +161,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
int totalBytes = LLUDPServer.MTU + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes;
AssertThrottles(
udpClient,
LLUDPServer.MTU, landBytes, windBytes, cloudBytes, taskBytes,
udpClient,
LLUDPServer.MTU, landBytes, windBytes, cloudBytes, taskBytes,
textureBytes, assetBytes, totalBytes, 0, 0);
}
@@ -181,7 +181,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene, ics);
ScenePresence sp
ScenePresence sp
= ClientStackHelpers.AddChildClient(
scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
@@ -207,7 +207,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
double commitRatio = 32000.0 / totalBytes;
AssertThrottles(
udpClient,
udpClient,
LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio,
textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0);
@@ -217,7 +217,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
commitRatio = (32000.0 + 20.0 * LLUDPServer.MTU) / totalBytes;
AssertThrottles(
udpClient,
udpClient,
LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio,
textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0);
@@ -227,7 +227,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
commitRatio = (32000.0 + (20.0 * LLUDPServer.MTU)/Math.Pow(2,1)) / totalBytes;
AssertThrottles(
udpClient,
udpClient,
LLUDPServer.MTU, landBytes * commitRatio, windBytes * commitRatio, cloudBytes * commitRatio, taskBytes * commitRatio,
textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0);
}
@@ -248,14 +248,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
int taskBytes = 14000;
int textureBytes = 16000;
int assetBytes = 18000;
int totalBytes
int totalBytes
= (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2);
Scene scene = new SceneHelpers().SetupScene();
TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene);
udpServer.Throttle.RequestedDripRate = totalBytes;
ScenePresence sp1
ScenePresence sp1
= ClientStackHelpers.AddChildClient(
scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
@@ -265,8 +265,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
AssertThrottles(
udpClient1,
resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2,
udpClient1,
resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2,
textureBytes / 2, assetBytes / 2, totalBytes, 0, 0);
// Test: Now add another client
@@ -281,13 +281,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
AssertThrottles(
udpClient1,
resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4,
udpClient1,
resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4,
textureBytes / 4, assetBytes / 4, totalBytes / 2, 0, 0);
AssertThrottles(
udpClient2,
resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4,
udpClient2,
resendBytes / 4, landBytes / 4, windBytes / 4, cloudBytes / 4, taskBytes / 4,
textureBytes / 4, assetBytes / 4, totalBytes / 2, 0, 0);
}
@@ -307,14 +307,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
int taskBytes = 12000;
int textureBytes = 14000;
int assetBytes = 16000;
int totalBytes
int totalBytes
= (int)((resendBytes + landBytes + windBytes + cloudBytes + taskBytes + textureBytes + assetBytes) / 2);
Scene scene = new SceneHelpers().SetupScene();
TestLLUDPServer udpServer = ClientStackHelpers.AddUdpServer(scene);
udpServer.ThrottleRates.Total = totalBytes;
ScenePresence sp
ScenePresence sp
= ClientStackHelpers.AddChildClient(
scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
@@ -325,8 +325,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpClient, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
AssertThrottles(
udpClient,
resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2,
udpClient,
resendBytes / 2, landBytes / 2, windBytes / 2, cloudBytes / 2, taskBytes / 2,
textureBytes / 2, assetBytes / 2, totalBytes, 0, totalBytes);
}
@@ -352,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpServer.ThrottleRates.Total = (int)(totalBytes * 1.1);
udpServer.Throttle.RequestedDripRate = (int)(totalBytes * 1.5);
ScenePresence sp1
ScenePresence sp1
= ClientStackHelpers.AddChildClient(
scene, udpServer, TestHelpers.ParseTail(0x1), TestHelpers.ParseTail(0x2), 123456);
@@ -363,8 +363,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpClient1, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
AssertThrottles(
udpClient1,
resendBytes, landBytes, windBytes, cloudBytes, taskBytes,
udpClient1,
resendBytes, landBytes, windBytes, cloudBytes, taskBytes,
textureBytes, assetBytes, totalBytes, 0, totalBytes * 1.1);
// Now add another client
@@ -379,25 +379,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
udpClient2, resendBytes, landBytes, windBytes, cloudBytes, taskBytes, textureBytes, assetBytes);
AssertThrottles(
udpClient1,
resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75,
udpClient1,
resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75,
textureBytes * 0.75, assetBytes * 0.75, totalBytes * 0.75, 0, totalBytes * 1.1);
AssertThrottles(
udpClient2,
resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75,
udpClient2,
resendBytes * 0.75, landBytes * 0.75, windBytes * 0.75, cloudBytes * 0.75, taskBytes * 0.75,
textureBytes * 0.75, assetBytes * 0.75, totalBytes * 0.75, 0, totalBytes * 1.1);
}
private void AssertThrottles(
LLUDPClient udpClient,
LLUDPClient udpClient,
double resendBytes, double landBytes, double windBytes, double cloudBytes, double taskBytes, double textureBytes, double assetBytes,
double totalBytes, double targetBytes, double maxBytes)
{
ClientInfo ci = udpClient.GetClientInfo();
// Console.WriteLine(
// "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}",
// "Resend={0}, Land={1}, Wind={2}, Cloud={3}, Task={4}, Texture={5}, Asset={6}, TOTAL = {7}",
// ci.resendThrottle, ci.landThrottle, ci.windThrottle, ci.cloudThrottle, ci.taskThrottle, ci.textureThrottle, ci.assetThrottle, ci.totalThrottle);
Assert.AreEqual((int)resendBytes, ci.resendThrottle, "Resend");