当前位置: 首页>>代码示例>>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;未经允许,请勿转载。