diff options
author | Robert Adams | 2014-01-28 21:43:18 -0800 |
---|---|---|
committer | Robert Adams | 2014-01-28 21:43:18 -0800 |
commit | 1900254e77b61f643f569621ace017052b27f792 (patch) | |
tree | 68f81cda7dddd99dc0cc5cbf6d2bea377e5a8b96 | |
parent | Temporarily disable brush test. It will come back when tuning is complete. (diff) | |
download | opensim-SC-1900254e77b61f643f569621ace017052b27f792.zip opensim-SC-1900254e77b61f643f569621ace017052b27f792.tar.gz opensim-SC-1900254e77b61f643f569621ace017052b27f792.tar.bz2 opensim-SC-1900254e77b61f643f569621ace017052b27f792.tar.xz |
Restore brush tests with correct values and adjustments for new terrain height
rounding characteristics.
-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] |