diff options
author | Justin Clark-Casey (justincc) | 2014-05-22 20:04:32 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-05-22 20:04:32 +0100 |
commit | bffc9ad18471076360692731597f89d232bb07b9 (patch) | |
tree | f83b0ab730eda357bcaa1b5a42678debb5dd7073 /OpenSim/Region | |
parent | Extend regression TestInterRegionChatDistanceEastWest() to test in range chat... (diff) | |
download | opensim-SC_OLD-bffc9ad18471076360692731597f89d232bb07b9.zip opensim-SC_OLD-bffc9ad18471076360692731597f89d232bb07b9.tar.gz opensim-SC_OLD-bffc9ad18471076360692731597f89d232bb07b9.tar.bz2 opensim-SC_OLD-bffc9ad18471076360692731597f89d232bb07b9.tar.xz |
Extend regression TestInterRegionChatDistanceEastWest() to test out of range chat
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs index fac9bd4..bdaa97b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/Tests/ChatModuleTests.cs | |||
@@ -150,28 +150,55 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests | |||
150 | new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), | 150 | new Vector3(sp2Position.X - sceneWest.RegionInfo.RegionSizeX, sp2Position.Y, sp2Position.Z), |
151 | sp2ChildClient.SceneAgent.AbsolutePosition); | 151 | sp2ChildClient.SceneAgent.AbsolutePosition); |
152 | 152 | ||
153 | // Check chat from sp1 | 153 | string receivedSp1ChatMessage = ""; |
154 | { | 154 | string receivedSp2ChatMessage = ""; |
155 | string receivedChatMessage = ""; | ||
156 | 155 | ||
157 | sp2ChildClient.OnReceivedChatMessage | 156 | sp1ChildClient.OnReceivedChatMessage |
158 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message; | 157 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp1ChatMessage = message; |
158 | sp2ChildClient.OnReceivedChatMessage | ||
159 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedSp2ChatMessage = message; | ||
159 | 160 | ||
161 | // Check chat from sp1 | ||
162 | { | ||
160 | string testMessage = "'ello darling"; | 163 | string testMessage = "'ello darling"; |
161 | sp1Client.Chat(0, ChatTypeEnum.Say, testMessage); | 164 | sp1Client.Chat(0, ChatTypeEnum.Say, testMessage); |
165 | |||
166 | // Assert.AreEqual(testMessage, receivedSp1ChatMessage); | ||
167 | Assert.AreEqual(testMessage, receivedSp2ChatMessage); | ||
162 | } | 168 | } |
163 | 169 | ||
164 | // Check chat from sp2 | 170 | // Check chat from sp2 |
171 | { | ||
172 | string testMessage = "fantastic cats"; | ||
173 | sp2Client.Chat(0, ChatTypeEnum.Say, testMessage); | ||
174 | |||
175 | Assert.AreEqual(testMessage, receivedSp1ChatMessage); | ||
176 | // Assert.AreEqual(testMessage, receivedSp2ChatMessage); | ||
177 | } | ||
178 | |||
179 | sp1Position = new Vector3(30, 128, 20); | ||
180 | sp1.AbsolutePosition = sp1Position; | ||
181 | sceneEast.Update(1); | ||
182 | |||
183 | // Check child position is correct. | ||
184 | Assert.AreEqual( | ||
185 | new Vector3(sp1Position.X + sceneEast.RegionInfo.RegionSizeX, sp1Position.Y, sp1Position.Z), | ||
186 | sp1ChildClient.SceneAgent.AbsolutePosition); | ||
187 | |||
188 | // sp2 should now be out of range for chat from sp1 | ||
165 | { | 189 | { |
166 | string receivedChatMessage = ""; | 190 | string testMessage = "beef"; |
191 | sp1Client.Chat(0, ChatTypeEnum.Say, testMessage); | ||
167 | 192 | ||
168 | sp1ChildClient.OnReceivedChatMessage | 193 | Assert.AreNotEqual(testMessage, receivedSp2ChatMessage); |
169 | += (message, type, fromPos, fromName, fromAgentID, ownerID, source, audible) => receivedChatMessage = message; | 194 | } |
170 | 195 | ||
171 | string testMessage = "fantastic cats"; | 196 | // sp1 should now be out of range for chat from sp2 |
197 | { | ||
198 | string testMessage = "lentils"; | ||
172 | sp2Client.Chat(0, ChatTypeEnum.Say, testMessage); | 199 | sp2Client.Chat(0, ChatTypeEnum.Say, testMessage); |
173 | 200 | ||
174 | Assert.AreEqual(testMessage, receivedChatMessage); | 201 | Assert.AreNotEqual(testMessage, receivedSp1ChatMessage); |
175 | } | 202 | } |
176 | } | 203 | } |
177 | } | 204 | } |