From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001
From: onefang
Date: Sun, 19 May 2019 21:24:15 +1000
Subject: Dump OpenSim 0.9.0.1 into it's own branch.
---
OpenSim/Framework/Tests/AgentCircuitDataTest.cs | 11 ++++++-----
.../Framework/Tests/AgentCircuitManagerTests.cs | 2 +-
OpenSim/Framework/Tests/AnimationTests.cs | 2 +-
OpenSim/Framework/Tests/CacheTests.cs | 4 ++--
OpenSim/Framework/Tests/LocationTest.cs | 2 +-
OpenSim/Framework/Tests/MundaneFrameworkTests.cs | 23 +++++++++++-----------
OpenSim/Framework/Tests/PrimeNumberHelperTests.cs | 6 +++---
OpenSim/Framework/Tests/UtilTest.cs | 13 ++++++------
8 files changed, 33 insertions(+), 30 deletions(-)
(limited to 'OpenSim/Framework/Tests')
diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
index 95e9439..5ad0030 100644
--- a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
+++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Tests
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOOT_SIZE] = 45;
- // head
+ // head
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SIZE] = 255;
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUASH_STRETCH_HEAD] = 0; // head stretch
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SHAPE] = 155;
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Tests
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FACE_SHEAR] = 127;
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOREHEAD_ANGLE] = 104;
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_BROW] = 94;
- VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks
+ VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 122; // lower cheeks
VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIGH_CHEEK_BONES] = 130;
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Tests
///
/// Test to ensure that the serialization format is the same and the underlying types don't change without notice
/// oldSerialization is just a json serialization of the OSDMap packed for the AgentCircuitData.
- /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types
+ /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types
/// have changed and are incompatible.
///
[Test]
@@ -311,14 +311,15 @@ namespace OpenSim.Framework.Tests
Agent1Data.SessionID = SessionId;
Agent1Data.startpos = StartPos;
+ EntityTransferContext ctx = new EntityTransferContext();
OSDMap map2;
- OSDMap map = Agent1Data.PackAgentCircuitData();
+ OSDMap map = Agent1Data.PackAgentCircuitData(ctx);
try
{
string str = OSDParser.SerializeJsonString(map);
//System.Console.WriteLine(str);
map2 = (OSDMap) OSDParser.DeserializeJson(str);
- }
+ }
catch (System.NullReferenceException)
{
//spurious litjson errors :P
diff --git a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
index ae132c8..b572afc 100644
--- a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
+++ b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Framework.Tests
resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1);
Assert.That(!resp.Authorised);
-
+
resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2);
Assert.That(!resp.Authorised);
diff --git a/OpenSim/Framework/Tests/AnimationTests.cs b/OpenSim/Framework/Tests/AnimationTests.cs
index d8f17d0..daf8611 100644
--- a/OpenSim/Framework/Tests/AnimationTests.cs
+++ b/OpenSim/Framework/Tests/AnimationTests.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Framework.Tests
anim4.AnimID = anim2.AnimID;
anim4.ObjectID = anim2.ObjectID;
anim4.SequenceNum = anim2.SequenceNum;
-
+
Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly.");
}
}
diff --git a/OpenSim/Framework/Tests/CacheTests.cs b/OpenSim/Framework/Tests/CacheTests.cs
index c709860..a92ff3c 100644
--- a/OpenSim/Framework/Tests/CacheTests.cs
+++ b/OpenSim/Framework/Tests/CacheTests.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Framework.Tests
Assert.That(citem == null, "Item should not be in Cache");
}
-
+
[Test]
public void ExpireItemManually()
{
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Tests
cachedItem.Store(foo);
cache.Store(cacheItemUUID.ToString(), cachedItem);
cache.Clear();
-
+
object citem = cache.Get(cacheItemUUID.ToString());
Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
}
diff --git a/OpenSim/Framework/Tests/LocationTest.cs b/OpenSim/Framework/Tests/LocationTest.cs
index 3d5d1d2..5e84026 100644
--- a/OpenSim/Framework/Tests/LocationTest.cs
+++ b/OpenSim/Framework/Tests/LocationTest.cs
@@ -85,6 +85,6 @@ namespace OpenSim.Framework.Tests
Assert.That(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test");
}
-
+
}
}
diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
index 3f0a031..bde7056 100644
--- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
+++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
@@ -110,13 +110,14 @@ namespace OpenSim.Framework.Tests
&& position2.Center == position1.Center
&& position2.RegionHandle == position1.RegionHandle
&& position2.Far == position1.Far
-
+
,"Copy From ChildAgentDataUpdate failed");
position2 = new AgentPosition();
Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition");
- position2.Unpack(position1.Pack(), null);
+ EntityTransferContext ctx = new EntityTransferContext();
+ position2.Unpack(position1.Pack(ctx), null, ctx);
Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed");
Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed");
@@ -147,13 +148,13 @@ namespace OpenSim.Framework.Tests
// string time = settings.LoadedCreationTime;
Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire");
-
+
}
public void RegionSaveFired(RegionSettings settings)
{
m_RegionSettingsOnSaveEventFired = true;
}
-
+
[Test]
public void InventoryItemBaseConstructorTest01()
{
@@ -163,7 +164,7 @@ namespace OpenSim.Framework.Tests
UUID ItemID = UUID.Random();
UUID OwnerID = UUID.Random();
-
+
InventoryItemBase b2 = new InventoryItemBase(ItemID);
Assert.That(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID");
Assert.That(b2.Owner == UUID.Zero, "ID constructor should create an inventory item with Owner = UUID.Zero");
@@ -218,12 +219,12 @@ namespace OpenSim.Framework.Tests
BannedHostNameMask = string.Empty,
BannedUserID = bannedUserId}
);
- Assert.IsTrue(es.IsBanned(bannedUserId), "User Should be banned but is not.");
- Assert.IsFalse(es.IsBanned(UUID.Zero), "User Should not be banned but is.");
+ Assert.IsTrue(es.IsBanned(bannedUserId, 32), "User Should be banned but is not.");
+ Assert.IsFalse(es.IsBanned(UUID.Zero, 32), "User Should not be banned but is.");
es.RemoveBan(bannedUserId);
- Assert.IsFalse(es.IsBanned(bannedUserId), "User Should not be banned but is.");
+ Assert.IsFalse(es.IsBanned(bannedUserId, 32), "User Should not be banned but is.");
es.AddEstateManager(UUID.Zero);
@@ -267,7 +268,7 @@ namespace OpenSim.Framework.Tests
Assert.That(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field.");
Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field.");
}
-
+
[Test]
public void AsssetBaseConstructorTest01()
{
@@ -303,6 +304,6 @@ namespace OpenSim.Framework.Tests
Culture.SetCurrentCulture();
Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US");
- }
+ }
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs
index 82e13e5..cc30fb9 100644
--- a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs
+++ b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs
@@ -127,9 +127,9 @@ namespace OpenSim.Framework.Tests
int[] nonprimes = {
4, 6, 8, 10, 14, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88,
- 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462,
- 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936,
- 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662,
+ 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462,
+ 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936,
+ 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662,
4672, 4678, 4690, 7740, 7752, 7756, 7758, 7788, 7792, 7816, 7822, 7828, 7840, 7852, 7866, 7872,
7876, 7878, 7882, 7900, 7906, 7918
};
diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs
index cfe3139..b3d79ee 100644
--- a/OpenSim/Framework/Tests/UtilTest.cs
+++ b/OpenSim/Framework/Tests/UtilTest.cs
@@ -59,12 +59,12 @@ namespace OpenSim.Framework.Tests
Assert.That(Util.GetMagnitude(v2),
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
"Magnitude of vector was incorrect.");
-
+/*
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True,
"Getting magnitude of null vector did not cause argument exception.");
-
+*/
Vector3 expectedNormalizedVector = new Vector3(.577f, .577f, .577f);
double expectedNormalizedMagnitude = 1;
Vector3 normalizedVector = Util.GetNormalizedVector(v2);
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Tests
Assert.That(Util.GetMagnitude(v2),
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
"Magnitude of vector was incorrect.");
-
+/*
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True,
@@ -102,6 +102,7 @@ namespace OpenSim.Framework.Tests
causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True,
"Getting magnitude of null vector did not cause argument exception.");
+*/
}
//Lets test a simple case of <0,0,0> and <-5,-5,-5>
@@ -120,12 +121,12 @@ namespace OpenSim.Framework.Tests
Assert.That(Util.GetMagnitude(v2),
new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
"Magnitude of vector was incorrect.");
-
+/*
TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
Assert.That(causesArgumentException, Is.True,
"Getting magnitude of null vector did not cause argument exception.");
-
+*/
Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f);
double expectedNormalizedMagnitude = 1;
Vector3 normalizedVector = Util.GetNormalizedVector(v2);
@@ -232,7 +233,7 @@ namespace OpenSim.Framework.Tests
"application/vnd.ll.clothing",
"application/vnd.ll.gesture"
};
-
+
for (int i=0;i