diff options
author | Mike Mazur | 2008-07-31 07:11:41 +0000 |
---|---|---|
committer | Mike Mazur | 2008-07-31 07:11:41 +0000 |
commit | 57ec7a26cda361eeac9d7f010194cfe0dfa6c281 (patch) | |
tree | eb8bb3680e3cb7db5449c3703835e6454e43ebbb /OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLString.cs | |
parent | Allow assignments in if/while/do-while control statements. Fix issue 1862. (diff) | |
download | opensim-SC_OLD-57ec7a26cda361eeac9d7f010194cfe0dfa6c281.zip opensim-SC_OLD-57ec7a26cda361eeac9d7f010194cfe0dfa6c281.tar.gz opensim-SC_OLD-57ec7a26cda361eeac9d7f010194cfe0dfa6c281.tar.bz2 opensim-SC_OLD-57ec7a26cda361eeac9d7f010194cfe0dfa6c281.tar.xz |
-make ZERO_VECTOR and ZERO_ROTATION static readonly properties so they can be
used in scripts
-cast from bool to LSL{Integer,Float,String} so functions such as `integer
isZero(integer x) { return (x == 0); }` work
-progress on issue 1863
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLString.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLString.cs b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLString.cs index 8fcb385..49e5023 100644 --- a/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLString.cs +++ b/OpenSim/Tests/OpenSim/Region/ScriptEngine/Shared/LSL_TypesTestLSLString.cs | |||
@@ -111,5 +111,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
111 | Assert.AreEqual(expectedQuaternion, stringQuaternion); | 111 | Assert.AreEqual(expectedQuaternion, stringQuaternion); |
112 | Assert.AreEqual(expectedQuaternion, LSLStringQuaternion); | 112 | Assert.AreEqual(expectedQuaternion, LSLStringQuaternion); |
113 | } | 113 | } |
114 | |||
115 | /// <summary> | ||
116 | /// Tests boolean correctly cast explicitly to LSLString. | ||
117 | /// </summary> | ||
118 | [Test] | ||
119 | public void TestImplicitCastBooleanToLSLFloat() | ||
120 | { | ||
121 | LSL_Types.LSLString testString; | ||
122 | |||
123 | testString = (LSL_Types.LSLString) (1 == 0); | ||
124 | Assert.AreEqual("0", testString.m_string); | ||
125 | |||
126 | testString = (LSL_Types.LSLString) (1 == 1); | ||
127 | Assert.AreEqual("1", testString.m_string); | ||
128 | |||
129 | testString = (LSL_Types.LSLString) false; | ||
130 | Assert.AreEqual("0", testString.m_string); | ||
131 | |||
132 | testString = (LSL_Types.LSLString) true; | ||
133 | Assert.AreEqual("1", testString.m_string); | ||
134 | } | ||
114 | } | 135 | } |
115 | } | 136 | } |