aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs20
1 files changed, 12 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
index 6aa8bcc..575e54c 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/LLImageManagerTests.cs
@@ -54,6 +54,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
54 [TestFixtureSetUp] 54 [TestFixtureSetUp]
55 public void FixtureInit() 55 public void FixtureInit()
56 { 56 {
57 // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
58 Util.FireAndForgetMethod = FireAndForgetMethod.None;
59
57 using ( 60 using (
58 Stream resource 61 Stream resource
59 = GetType().Assembly.GetManifestResourceStream( 62 = GetType().Assembly.GetManifestResourceStream(
@@ -73,6 +76,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
73 } 76 }
74 } 77 }
75 78
79 [TestFixtureTearDown]
80 public void TearDown()
81 {
82 // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
83 // threads. Possibly, later tests should be rewritten not to worry about such things.
84 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
85 }
86
76 [SetUp] 87 [SetUp]
77 public override void SetUp() 88 public override void SetUp()
78 { 89 {
@@ -106,14 +117,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
106 args.requestSequence = 1; 117 args.requestSequence = 1;
107 118
108 llim.EnqueueReq(args); 119 llim.EnqueueReq(args);
109 120 llim.ProcessImageQueue(20);
110 // We now have to wait and hit the processing wheel, because the decoding is async
111 int i = 10;
112 while (i-- > 0)
113 {
114 llim.ProcessImageQueue(20);
115 Thread.Sleep(100);
116 }
117 121
118 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(1)); 122 Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(1));
119 } 123 }