當前位置: 首頁>>代碼示例>>C#>>正文


C# SceneHelpers.Update方法代碼示例

本文整理匯總了C#中OpenSim.Tests.Common.SceneHelpers.Update方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneHelpers.Update方法的具體用法?C# SceneHelpers.Update怎麽用?C# SceneHelpers.Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Tests.Common.SceneHelpers的用法示例。


在下文中一共展示了SceneHelpers.Update方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestUpdateScene

        public void TestUpdateScene()
        {
            TestHelpers.InMethod();

            Scene scene = new SceneHelpers().SetupScene();
            scene.Update(1);
            
            Assert.That(scene.Frame, Is.EqualTo(1));
        }
開發者ID:CCIR,項目名稱:opensim,代碼行數:9,代碼來源:SceneTests.cs

示例2: TestShutdownScene

        public void TestShutdownScene()
        {
            TestHelpers.InMethod();

            Scene scene = new SceneHelpers().SetupScene();
            scene.Close();

            Assert.That(scene.ShuttingDown, Is.True);
            Assert.That(scene.Active, Is.False);

            // Trying to update a shutdown scene should result in no update
            scene.Update(1);

            Assert.That(scene.Frame, Is.EqualTo(0));
        }
開發者ID:CCIR,項目名稱:opensim,代碼行數:15,代碼來源:SceneTests.cs

示例3: TestAddObjects

        private void TestAddObjects(int primsInEachObject, int objectsToAdd)
        {
            UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000");

            // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage
            // collected when we teardown this test.  If it's done in a member variable, even if that is subsequently
            // nulled out, the garbage collect can be delayed.
            TestScene scene = new SceneHelpers().SetupScene();

//            Process process = Process.GetCurrentProcess();
//            long startProcessMemory = process.PrivateMemorySize64;
            long startGcMemory = GC.GetTotalMemory(true);
            DateTime start = DateTime.Now;

            for (int i = 1; i <= objectsToAdd; i++)
            {
                SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId, "part_", i);
                Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i));
            }

            TimeSpan elapsed = DateTime.Now - start;
//            long processMemoryAlloc = process.PrivateMemorySize64 - startProcessMemory;
            long endGcMemory = GC.GetTotalMemory(false);

            for (int i = 1; i <= objectsToAdd; i++)
            {
                Assert.That(
                    scene.GetSceneObjectGroup(TestHelpers.ParseTail(i)),
                    Is.Not.Null,
                    string.Format("Object {0} could not be retrieved", i));
            }

            // When a scene object is added to a scene, it is placed in the update list for sending to viewers
            // (though in this case we have none).  When it is deleted, it is not removed from the update which is
            // fine since it will later be ignored.
            //
            // However, that means that we need to manually run an update here to clear out that list so that deleted
            // objects will be clean up by the garbage collector before the next stress test is run.
            scene.Update(1);

            Console.WriteLine(
                "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
                Math.Round(elapsed.TotalMilliseconds),
                (endGcMemory - startGcMemory) / 1024 / 1024,
                endGcMemory / 1024 / 1024,
                startGcMemory / 1024 / 1024,
                objectsToAdd,
                primsInEachObject);

            scene.Close();
//            scene = null;
        }
開發者ID:JAllard,項目名稱:opensim,代碼行數:52,代碼來源:ObjectTortureTests.cs


注:本文中的OpenSim.Tests.Common.SceneHelpers.Update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。