From 47648557c1ff6cfff378a1f783b60e9a9868018e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 28 Aug 2017 10:48:46 +0100 Subject: [PATCH] fix some nunit tests --- .../Tests/FetchInventoryDescendents2HandlerTests.cs | 5 +++-- .../Linden/Caps/EventQueue/Tests/EventQueueTests.cs | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs index 4143aa33af..1e9a993494 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/Tests/FetchInventoryDescendents2HandlerTests.cs @@ -267,6 +267,7 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests [Test] public void Test_005_FolderZero() { + TestHelpers.InMethod(); Init(); @@ -283,11 +284,11 @@ namespace OpenSim.Capabilities.Handlers.FetchInventory.Tests Assert.That(llsdresponse != null, Is.True, "Incorrect null response"); Assert.That(llsdresponse != string.Empty, Is.True, "Incorrect empty response"); - Assert.That(llsdresponse.Contains("bad_folders00000000-0000-0000-0000-000000000000"), Is.True, "Folder Zero should be a bad folder"); + // we do return a answer now + //Assert.That(llsdresponse.Contains("bad_folders00000000-0000-0000-0000-000000000000"), Is.True, "Folder Zero should be a bad folder"); Console.WriteLine(llsdresponse); } - } } \ No newline at end of file diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index b23bffc35f..080cef929a 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Net; +using System.Text; using log4net.Config; using Nini.Config; using NUnit.Framework; @@ -125,7 +126,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests Hashtable eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); // initial queue as null events - eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); +// eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); if((int)eventsResponse["int_response_code"] != (int)HttpStatusCode.OK) { eventsResponse = m_eqgMod.GetEvents(UUID.Zero, sp.UUID); @@ -136,8 +137,11 @@ namespace OpenSim.Region.ClientStack.Linden.Tests Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.OK)); // Console.WriteLine("Response [{0}]", (string)eventsResponse["str_response_string"]); + string data = String.Empty; + if(eventsResponse["bin_response_data"] != null) + data = Encoding.UTF8.GetString((byte[])eventsResponse["bin_response_data"]); - OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml((string)eventsResponse["str_response_string"]); + OSDMap rawOsd = (OSDMap)OSDParser.DeserializeLLSDXml(data); OSDArray eventsOsd = (OSDArray)rawOsd["events"]; bool foundUpdate = false;