diff options
author | Mic Bowman | 2014-01-28 22:42:35 -0800 |
---|---|---|
committer | Mic Bowman | 2014-01-28 22:42:35 -0800 |
commit | fbf33ef1de0229250404557f89375b5f6322e0c6 (patch) | |
tree | c576ac0bfd3e4d946267b13ced3213c19cd97e23 | |
parent | One more run at fixing the sun module. Parameter setting fixed to (diff) | |
parent | Restore brush tests with correct values and adjustments for new terrain height (diff) | |
download | opensim-SC_OLD-fbf33ef1de0229250404557f89375b5f6322e0c6.zip opensim-SC_OLD-fbf33ef1de0229250404557f89375b5f6322e0c6.tar.gz opensim-SC_OLD-fbf33ef1de0229250404557f89375b5f6322e0c6.tar.bz2 opensim-SC_OLD-fbf33ef1de0229250404557f89375b5f6322e0c6.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs index ff4cdfe..96c16a9 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs | |||
@@ -40,10 +40,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests | |||
40 | [Test] | 40 | [Test] |
41 | public void BrushTest() | 41 | public void BrushTest() |
42 | { | 42 | { |
43 | int midRegion = (int)Constants.RegionSize / 2; | ||
44 | |||
45 | // Create a mask that covers only the left half of the region | ||
43 | bool[,] allowMask = new bool[(int)Constants.RegionSize, 256]; | 46 | bool[,] allowMask = new bool[(int)Constants.RegionSize, 256]; |
44 | int x; | 47 | int x; |
45 | int y; | 48 | int y; |
46 | for (x = 0; x < (int)((int)Constants.RegionSize * 0.5f); x++) | 49 | for (x = 0; x < midRegion; x++) |
47 | { | 50 | { |
48 | for (y = 0; y < (int)Constants.RegionSize; y++) | 51 | for (y = 0; y < (int)Constants.RegionSize; y++) |
49 | { | 52 | { |
@@ -51,20 +54,18 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests | |||
51 | } | 54 | } |
52 | } | 55 | } |
53 | 56 | ||
54 | /* | ||
55 | // | 57 | // |
56 | // Test RaiseSphere | 58 | // Test RaiseSphere |
57 | // | 59 | // |
58 | TerrainChannel map = new TerrainChannel((int)Constants.RegionSize, (int)Constants.RegionSize); | 60 | TerrainChannel map = new TerrainChannel((int)Constants.RegionSize, (int)Constants.RegionSize); |
59 | ITerrainPaintableEffect effect = new RaiseSphere(); | 61 | ITerrainPaintableEffect effect = new RaiseSphere(); |
60 | 62 | ||
61 | effect.PaintEffect(map, allowMask, (int)Constants.RegionSize * 0.5f, (int)Constants.RegionSize * 0.5f, -1.0, 4, 0.1); | 63 | effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0, 2, 6.0); |
62 | Assert.That(map[127, (int)((int)Constants.RegionSize * 0.5f)] > 0.0, "Raise brush should raising value at this point (127,128)."); | 64 | Assert.That(map[127, midRegion] > 0.0, "Raise brush should raising value at this point (127,128)."); |
63 | Assert.That(map[124, (int)((int)Constants.RegionSize * 0.5f)] > 0.0, "Raise brush should raising value at this point (124,128)."); | 65 | Assert.That(map[125, midRegion] > 0.0, "Raise brush should raising value at this point (124,128)."); |
64 | Assert.That(map[120, (int)((int)Constants.RegionSize * 0.5f)] == 0.0, "Raise brush should not change value at this point (120,128)."); | 66 | Assert.That(map[120, midRegion] == 0.0, "Raise brush should not change value at this point (120,128)."); |
65 | Assert.That(map[128, (int)((int)Constants.RegionSize * 0.5f)] == 0.0, "Raise brush should not change value at this point (128,128)."); | 67 | Assert.That(map[128, midRegion] == 0.0, "Raise brush should not change value at this point (128,128)."); |
66 | Assert.That(map[0, (int)((int)Constants.RegionSize * 0.5f)] == 0.0, "Raise brush should not change value at this point (0,128)."); | 68 | Assert.That(map[0, midRegion] == 0.0, "Raise brush should not change value at this point (0,128)."); |
67 | |||
68 | // | 69 | // |
69 | // Test LowerSphere | 70 | // Test LowerSphere |
70 | // | 71 | // |
@@ -78,14 +79,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests | |||
78 | } | 79 | } |
79 | effect = new LowerSphere(); | 80 | effect = new LowerSphere(); |
80 | 81 | ||
81 | effect.PaintEffect(map, allowMask, ((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), -1.0, 4, 6.0); | 82 | effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0, 2, 6.0); |
82 | Assert.That(map[127, (int)((int)Constants.RegionSize * 0.5f)] >= 0.0, "Lower should not lowering value below 0.0 at this point (127,128)."); | 83 | Assert.That(map[127, midRegion] >= 0.0, "Lower should not lowering value below 0.0 at this point (127,128)."); |
83 | Assert.That(map[127, (int)((int)Constants.RegionSize * 0.5f)] == 0.0, "Lower brush should lowering value to 0.0 at this point (127,128)."); | 84 | Assert.That(map[127, midRegion] == 0.0, "Lower brush should lowering value to 0.0 at this point (127,128)."); |
84 | Assert.That(map[124, (int)((int)Constants.RegionSize * 0.5f)] < 1.0, "Lower brush should lowering value at this point (124,128)."); | 85 | Assert.That(map[125, midRegion] < 1.0, "Lower brush should lowering value at this point (124,128)."); |
85 | Assert.That(map[120, (int)((int)Constants.RegionSize * 0.5f)] == 1.0, "Lower brush should not change value at this point (120,128)."); | 86 | Assert.That(map[120, midRegion] == 1.0, "Lower brush should not change value at this point (120,128)."); |
86 | Assert.That(map[128, (int)((int)Constants.RegionSize * 0.5f)] == 1.0, "Lower brush should not change value at this point (128,128)."); | 87 | Assert.That(map[128, midRegion] == 1.0, "Lower brush should not change value at this point (128,128)."); |
87 | Assert.That(map[0, (int)((int)Constants.RegionSize * 0.5f)] == 1.0, "Lower brush should not change value at this point (0,128)."); | 88 | Assert.That(map[0, midRegion] == 1.0, "Lower brush should not change value at this point (0,128)."); |
88 | */ | ||
89 | } | 89 | } |
90 | 90 | ||
91 | [Test] | 91 | [Test] |