29 using NUnit.Framework;
30 using OpenSim.Framework;
31 using OpenSim.Region.CoreModules.World.Terrain.PaintBrushes;
32 using OpenSim.Region.Framework.Scenes;
33 using OpenSim.Tests.Common;
46 bool[,] allowMask =
new bool[(
int)Constants.RegionSize, 256];
49 for (x = 0; x < midRegion; x++)
53 allowMask[x,y] =
true;
63 effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0, 2, 6.0,
65 Assert.That(map[127, midRegion] > 0.0,
"Raise brush should raising value at this point (127,128).");
66 Assert.That(map[125, midRegion] > 0.0,
"Raise brush should raising value at this point (124,128).");
67 Assert.That(map[120, midRegion] == 0.0,
"Raise brush should not change value at this point (120,128).");
68 Assert.That(map[128, midRegion] == 0.0,
"Raise brush should not change value at this point (128,128).");
74 for (x=0; x<map.Width; x++)
76 for (y=0; y<map.Height; y++)
83 effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0, 2, 6.0,
85 Assert.That(map[127, midRegion] >= 0.0,
"Lower should not lowering value below 0.0 at this point (127,128).");
86 Assert.That(map[127, midRegion] == 0.0,
"Lower brush should lowering value to 0.0 at this point (127,128).");
87 Assert.That(map[125, midRegion] < 1.0,
"Lower brush should lowering value at this point (124,128).");
88 Assert.That(map[120, midRegion] == 1.0,
"Lower brush should not change value at this point (120,128).");
89 Assert.That(map[128, midRegion] == 1.0,
"Lower brush should not change value at this point (128,128).");
97 Assert.That(x[0, 0] == 0.0,
"Terrain not initialising correctly.");
100 Assert.That(x[0, 0] == 1.0,
"Terrain not setting values correctly.");
105 Assert.That(x[0, 0] == 4.0,
"Terrain addition/subtraction error.");
108 float[] floatsExport = x.GetFloatsSerialised();
109 Assert.That(floatsExport[0] == 1.0f,
"Export to float[] not working correctly.");
112 Assert.That(x.Tainted(0, 0),
"Terrain channel tainting not working correctly.");
113 Assert.That(!x.Tainted(0, 0),
"Terrain channel tainting not working correctly.");
116 Assert.That(!ReferenceEquals(x, y),
"Terrain copy not duplicating correctly.");
117 Assert.That(!ReferenceEquals(x.GetDoubles(), y.GetDoubles()),
"Terrain array not duplicating correctly.");
void TerrainChannelTest()
Interactive OpenSim region server
A new version of the old Channel class, simplified