diff options
author | Justin Clark-Casey (justincc) | 2012-09-26 22:49:44 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-26 22:49:44 +0100 |
commit | 327320d1a7acbba969d26c281f92f64ce8ff365f (patch) | |
tree | fe6709dba92015f98cd173f8d2873ed44c4a5d3b /OpenSim/Region/Framework/Scenes/Tests | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-327320d1a7acbba969d26c281f92f64ce8ff365f.zip opensim-SC_OLD-327320d1a7acbba969d26c281f92f64ce8ff365f.tar.gz opensim-SC_OLD-327320d1a7acbba969d26c281f92f64ce8ff365f.tar.bz2 opensim-SC_OLD-327320d1a7acbba969d26c281f92f64ce8ff365f.tar.xz |
Enforce existing 5 action hardcoded undo limit.
This was present in the code but not enforced, which led to a memory leak over time as part properties were changed, whether by viewer, script or another source.
This commit enforces that limit, which will soon become configurable.
Regression test for undo limit added
Should help with http://opensimulator.org/mantis/view.php?id=6279
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs index 1e317c6..c93562d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs | |||
@@ -76,6 +76,33 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
76 | } | 76 | } |
77 | 77 | ||
78 | [Test] | 78 | [Test] |
79 | public void TestUndoLimit() | ||
80 | { | ||
81 | TestHelpers.InMethod(); | ||
82 | |||
83 | Vector3 firstSize = new Vector3(2, 3, 4); | ||
84 | Vector3 secondSize = new Vector3(5, 6, 7); | ||
85 | Vector3 thirdSize = new Vector3(8, 9, 10); | ||
86 | Vector3 fourthSize = new Vector3(11, 12, 13); | ||
87 | |||
88 | Scene scene = new SceneHelpers().SetupScene(); | ||
89 | scene.MaxUndoCount = 2; | ||
90 | SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); | ||
91 | |||
92 | g1.GroupResize(firstSize); | ||
93 | g1.GroupResize(secondSize); | ||
94 | g1.GroupResize(thirdSize); | ||
95 | g1.GroupResize(fourthSize); | ||
96 | |||
97 | g1.RootPart.Undo(); | ||
98 | g1.RootPart.Undo(); | ||
99 | g1.RootPart.Undo(); | ||
100 | |||
101 | Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); | ||
102 | Assert.That(g1.GroupScale, Is.EqualTo(secondSize)); | ||
103 | } | ||
104 | |||
105 | [Test] | ||
79 | public void TestUndoBeyondAvailable() | 106 | public void TestUndoBeyondAvailable() |
80 | { | 107 | { |
81 | TestHelpers.InMethod(); | 108 | TestHelpers.InMethod(); |