Adapt the unit tests to the new list rules, change some casts to

new method for testing
This commit is contained in:
Melanie Thielker
2008-09-08 19:29:16 +00:00
parent e7abde70a2
commit 6447d7132f
3 changed files with 35 additions and 29 deletions

View File

@@ -5614,12 +5614,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (remain < 6)
return;
face = Convert.ToInt32(rules.Data[idx++].ToString()); // holeshape
v = new LSL_Types.Vector3(rules.Data[idx++].ToString()); // cut
hollow = (float)Convert.ToDouble(rules.Data[idx++].ToString());
twist = new LSL_Types.Vector3(rules.Data[idx++].ToString());
taper_b = new LSL_Types.Vector3(rules.Data[idx++].ToString());
topshear = new LSL_Types.Vector3(rules.Data[idx++].ToString());
face = (int)rules.GetLSLIntegerItem(idx++);
v = rules.GetVector3Item(idx++); // cut
hollow = (float)rules.GetLSLFloatItem(idx++);
twist = rules.GetVector3Item(idx++);
taper_b = rules.GetVector3Item(idx++);
topshear = rules.GetVector3Item(idx++);
part.Shape.PathCurve = (byte)Extrusion.Straight;
SetPrimitiveShapeParams(part, face, v, hollow, twist, taper_b, topshear, 1);
break;

View File

@@ -454,7 +454,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
public LSL_Types.LSLInteger GetLSLIntegerItem(int itemIndex)
{
return (LSL_Types.LSLInteger)m_data[itemIndex];
if (m_data[itemIndex] is LSL_Types.LSLInteger)
return (LSL_Types.LSLInteger)m_data[itemIndex];
else if (m_data[itemIndex] is Int32)
return new LSLInteger((int)m_data[itemIndex]);
else
throw new InvalidCastException();
}
public LSL_Types.Vector3 GetVector3Item(int itemIndex)