aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Tests
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/Tests
parentAdd a build script. (diff)
downloadopensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Framework/Tests')
-rw-r--r--OpenSim/Framework/Tests/AgentCircuitDataTest.cs11
-rw-r--r--OpenSim/Framework/Tests/AgentCircuitManagerTests.cs2
-rw-r--r--OpenSim/Framework/Tests/AnimationTests.cs2
-rw-r--r--OpenSim/Framework/Tests/CacheTests.cs4
-rw-r--r--OpenSim/Framework/Tests/LocationTest.cs2
-rw-r--r--OpenSim/Framework/Tests/MundaneFrameworkTests.cs23
-rw-r--r--OpenSim/Framework/Tests/PrimeNumberHelperTests.cs6
-rw-r--r--OpenSim/Framework/Tests/UtilTest.cs13
8 files changed, 33 insertions, 30 deletions
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
96 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOOT_SIZE] = 45; 96 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOOT_SIZE] = 45;
97 97
98 98
99 // head 99 // head
100 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SIZE] = 255; 100 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SIZE] = 255;
101 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUASH_STRETCH_HEAD] = 0; // head stretch 101 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_SQUASH_STRETCH_HEAD] = 0; // head stretch
102 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SHAPE] = 155; 102 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEAD_SHAPE] = 155;
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Tests
106 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FACE_SHEAR] = 127; 106 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FACE_SHEAR] = 127;
107 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOREHEAD_ANGLE] = 104; 107 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_FOREHEAD_ANGLE] = 104;
108 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_BROW] = 94; 108 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_BIG_BROW] = 94;
109 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks 109 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_PUFFY_UPPER_CHEEKS] = 0; // upper cheeks
110 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 122; // lower cheeks 110 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_DOUBLE_CHIN] = 122; // lower cheeks
111 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIGH_CHEEK_BONES] = 130; 111 VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HIGH_CHEEK_BONES] = 130;
112 112
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Tests
232 /// <summary> 232 /// <summary>
233 /// Test to ensure that the serialization format is the same and the underlying types don't change without notice 233 /// Test to ensure that the serialization format is the same and the underlying types don't change without notice
234 /// oldSerialization is just a json serialization of the OSDMap packed for the AgentCircuitData. 234 /// oldSerialization is just a json serialization of the OSDMap packed for the AgentCircuitData.
235 /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types 235 /// The idea is that if the current json serializer cannot parse the old serialization, then the underlying types
236 /// have changed and are incompatible. 236 /// have changed and are incompatible.
237 /// </summary> 237 /// </summary>
238 [Test] 238 [Test]
@@ -311,14 +311,15 @@ namespace OpenSim.Framework.Tests
311 Agent1Data.SessionID = SessionId; 311 Agent1Data.SessionID = SessionId;
312 Agent1Data.startpos = StartPos; 312 Agent1Data.startpos = StartPos;
313 313
314 EntityTransferContext ctx = new EntityTransferContext();
314 OSDMap map2; 315 OSDMap map2;
315 OSDMap map = Agent1Data.PackAgentCircuitData(); 316 OSDMap map = Agent1Data.PackAgentCircuitData(ctx);
316 try 317 try
317 { 318 {
318 string str = OSDParser.SerializeJsonString(map); 319 string str = OSDParser.SerializeJsonString(map);
319 //System.Console.WriteLine(str); 320 //System.Console.WriteLine(str);
320 map2 = (OSDMap) OSDParser.DeserializeJson(str); 321 map2 = (OSDMap) OSDParser.DeserializeJson(str);
321 } 322 }
322 catch (System.NullReferenceException) 323 catch (System.NullReferenceException)
323 { 324 {
324 //spurious litjson errors :P 325 //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
183 183
184 resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1); 184 resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1);
185 Assert.That(!resp.Authorised); 185 Assert.That(!resp.Authorised);
186 186
187 resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2); 187 resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2);
188 Assert.That(!resp.Authorised); 188 Assert.That(!resp.Authorised);
189 189
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
84 anim4.AnimID = anim2.AnimID; 84 anim4.AnimID = anim2.AnimID;
85 anim4.ObjectID = anim2.ObjectID; 85 anim4.ObjectID = anim2.ObjectID;
86 anim4.SequenceNum = anim2.SequenceNum; 86 anim4.SequenceNum = anim2.SequenceNum;
87 87
88 Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly."); 88 Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly.");
89 } 89 }
90 } 90 }
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
70 Assert.That(citem == null, "Item should not be in Cache"); 70 Assert.That(citem == null, "Item should not be in Cache");
71 } 71 }
72 72
73 73
74 [Test] 74 [Test]
75 public void ExpireItemManually() 75 public void ExpireItemManually()
76 { 76 {
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.Tests
96 cachedItem.Store(foo); 96 cachedItem.Store(foo);
97 cache.Store(cacheItemUUID.ToString(), cachedItem); 97 cache.Store(cacheItemUUID.ToString(), cachedItem);
98 cache.Clear(); 98 cache.Clear();
99 99
100 object citem = cache.Get(cacheItemUUID.ToString()); 100 object citem = cache.Get(cacheItemUUID.ToString());
101 Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); 101 Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
102 } 102 }
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
85 Assert.That(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test"); 85 Assert.That(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test");
86 86
87 } 87 }
88 88
89 } 89 }
90} 90}
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
110 && position2.Center == position1.Center 110 && position2.Center == position1.Center
111 && position2.RegionHandle == position1.RegionHandle 111 && position2.RegionHandle == position1.RegionHandle
112 && position2.Far == position1.Far 112 && position2.Far == position1.Far
113 113
114 ,"Copy From ChildAgentDataUpdate failed"); 114 ,"Copy From ChildAgentDataUpdate failed");
115 115
116 position2 = new AgentPosition(); 116 position2 = new AgentPosition();
117 117
118 Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition"); 118 Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition");
119 position2.Unpack(position1.Pack(), null); 119 EntityTransferContext ctx = new EntityTransferContext();
120 position2.Unpack(position1.Pack(ctx), null, ctx);
120 121
121 Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed"); 122 Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed");
122 Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed"); 123 Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed");
@@ -147,13 +148,13 @@ namespace OpenSim.Framework.Tests
147// string time = settings.LoadedCreationTime; 148// string time = settings.LoadedCreationTime;
148 149
149 Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire"); 150 Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire");
150 151
151 } 152 }
152 public void RegionSaveFired(RegionSettings settings) 153 public void RegionSaveFired(RegionSettings settings)
153 { 154 {
154 m_RegionSettingsOnSaveEventFired = true; 155 m_RegionSettingsOnSaveEventFired = true;
155 } 156 }
156 157
157 [Test] 158 [Test]
158 public void InventoryItemBaseConstructorTest01() 159 public void InventoryItemBaseConstructorTest01()
159 { 160 {
@@ -163,7 +164,7 @@ namespace OpenSim.Framework.Tests
163 164
164 UUID ItemID = UUID.Random(); 165 UUID ItemID = UUID.Random();
165 UUID OwnerID = UUID.Random(); 166 UUID OwnerID = UUID.Random();
166 167
167 InventoryItemBase b2 = new InventoryItemBase(ItemID); 168 InventoryItemBase b2 = new InventoryItemBase(ItemID);
168 Assert.That(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID"); 169 Assert.That(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID");
169 Assert.That(b2.Owner == UUID.Zero, "ID constructor should create an inventory item with Owner = UUID.Zero"); 170 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
218 BannedHostNameMask = string.Empty, 219 BannedHostNameMask = string.Empty,
219 BannedUserID = bannedUserId} 220 BannedUserID = bannedUserId}
220 ); 221 );
221 Assert.IsTrue(es.IsBanned(bannedUserId), "User Should be banned but is not."); 222 Assert.IsTrue(es.IsBanned(bannedUserId, 32), "User Should be banned but is not.");
222 Assert.IsFalse(es.IsBanned(UUID.Zero), "User Should not be banned but is."); 223 Assert.IsFalse(es.IsBanned(UUID.Zero, 32), "User Should not be banned but is.");
223 224
224 es.RemoveBan(bannedUserId); 225 es.RemoveBan(bannedUserId);
225 226
226 Assert.IsFalse(es.IsBanned(bannedUserId), "User Should not be banned but is."); 227 Assert.IsFalse(es.IsBanned(bannedUserId, 32), "User Should not be banned but is.");
227 228
228 es.AddEstateManager(UUID.Zero); 229 es.AddEstateManager(UUID.Zero);
229 230
@@ -267,7 +268,7 @@ namespace OpenSim.Framework.Tests
267 Assert.That(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field."); 268 Assert.That(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field.");
268 Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field."); 269 Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field.");
269 } 270 }
270 271
271 [Test] 272 [Test]
272 public void AsssetBaseConstructorTest01() 273 public void AsssetBaseConstructorTest01()
273 { 274 {
@@ -303,6 +304,6 @@ namespace OpenSim.Framework.Tests
303 Culture.SetCurrentCulture(); 304 Culture.SetCurrentCulture();
304 Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US"); 305 Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US");
305 306
306 } 307 }
307 } 308 }
308} \ No newline at end of file 309}
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
127 127
128 int[] nonprimes = { 128 int[] nonprimes = {
129 4, 6, 8, 10, 14, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, 129 4, 6, 8, 10, 14, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88,
130 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462, 130 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462,
131 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936, 131 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936,
132 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662, 132 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662,
133 4672, 4678, 4690, 7740, 7752, 7756, 7758, 7788, 7792, 7816, 7822, 7828, 7840, 7852, 7866, 7872, 133 4672, 4678, 4690, 7740, 7752, 7756, 7758, 7788, 7792, 7816, 7822, 7828, 7840, 7852, 7866, 7872,
134 7876, 7878, 7882, 7900, 7906, 7918 134 7876, 7878, 7882, 7900, 7906, 7918
135 }; 135 };
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
59 Assert.That(Util.GetMagnitude(v2), 59 Assert.That(Util.GetMagnitude(v2),
60 new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), 60 new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
61 "Magnitude of vector was incorrect."); 61 "Magnitude of vector was incorrect.");
62 62/*
63 TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; 63 TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
64 bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); 64 bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
65 Assert.That(causesArgumentException, Is.True, 65 Assert.That(causesArgumentException, Is.True,
66 "Getting magnitude of null vector did not cause argument exception."); 66 "Getting magnitude of null vector did not cause argument exception.");
67 67*/
68 Vector3 expectedNormalizedVector = new Vector3(.577f, .577f, .577f); 68 Vector3 expectedNormalizedVector = new Vector3(.577f, .577f, .577f);
69 double expectedNormalizedMagnitude = 1; 69 double expectedNormalizedMagnitude = 1;
70 Vector3 normalizedVector = Util.GetNormalizedVector(v2); 70 Vector3 normalizedVector = Util.GetNormalizedVector(v2);
@@ -92,7 +92,7 @@ namespace OpenSim.Framework.Tests
92 Assert.That(Util.GetMagnitude(v2), 92 Assert.That(Util.GetMagnitude(v2),
93 new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), 93 new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
94 "Magnitude of vector was incorrect."); 94 "Magnitude of vector was incorrect.");
95 95/*
96 TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; 96 TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
97 bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); 97 bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
98 Assert.That(causesArgumentException, Is.True, 98 Assert.That(causesArgumentException, Is.True,
@@ -102,6 +102,7 @@ namespace OpenSim.Framework.Tests
102 causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); 102 causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
103 Assert.That(causesArgumentException, Is.True, 103 Assert.That(causesArgumentException, Is.True,
104 "Getting magnitude of null vector did not cause argument exception."); 104 "Getting magnitude of null vector did not cause argument exception.");
105*/
105 } 106 }
106 107
107 //Lets test a simple case of <0,0,0> and <-5,-5,-5> 108 //Lets test a simple case of <0,0,0> and <-5,-5,-5>
@@ -120,12 +121,12 @@ namespace OpenSim.Framework.Tests
120 Assert.That(Util.GetMagnitude(v2), 121 Assert.That(Util.GetMagnitude(v2),
121 new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance), 122 new DoubleToleranceConstraint(expectedMagnitude, lowPrecisionTolerance),
122 "Magnitude of vector was incorrect."); 123 "Magnitude of vector was incorrect.");
123 124/*
124 TestDelegate d = delegate() { Util.GetNormalizedVector(v1); }; 125 TestDelegate d = delegate() { Util.GetNormalizedVector(v1); };
125 bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d); 126 bool causesArgumentException = TestHelpers.AssertThisDelegateCausesArgumentException(d);
126 Assert.That(causesArgumentException, Is.True, 127 Assert.That(causesArgumentException, Is.True,
127 "Getting magnitude of null vector did not cause argument exception."); 128 "Getting magnitude of null vector did not cause argument exception.");
128 129*/
129 Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f); 130 Vector3 expectedNormalizedVector = new Vector3(-.577f, -.577f, -.577f);
130 double expectedNormalizedMagnitude = 1; 131 double expectedNormalizedMagnitude = 1;
131 Vector3 normalizedVector = Util.GetNormalizedVector(v2); 132 Vector3 normalizedVector = Util.GetNormalizedVector(v2);
@@ -232,7 +233,7 @@ namespace OpenSim.Framework.Tests
232 "application/vnd.ll.clothing", 233 "application/vnd.ll.clothing",
233 "application/vnd.ll.gesture" 234 "application/vnd.ll.gesture"
234 }; 235 };
235 236
236 for (int i=0;i<inventorytypes.Length;i++) 237 for (int i=0;i<inventorytypes.Length;i++)
237 { 238 {
238 Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]), 239 Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]),