diff options
author | Melanie Thielker | 2008-09-08 19:29:16 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-08 19:29:16 +0000 |
commit | 6447d7132f0f443205e719a00e595f79444eea25 (patch) | |
tree | d28bbcc81e3ba99085ff679f29116111327b8c49 /OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs | |
parent | Mantis #2147 (diff) | |
download | opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.zip opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.tar.gz opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.tar.bz2 opensim-SC_OLD-6447d7132f0f443205e719a00e595f79444eea25.tar.xz |
Adapt the unit tests to the new list rules, change some casts to
new method for testing
Diffstat (limited to 'OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs')
-rw-r--r-- | OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs b/OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs index ca59c97..7da28dd 100644 --- a/OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs +++ b/OpenSim/Tests/Region/ScriptEngine/Shared/LSL_TypesTestList.cs | |||
@@ -44,18 +44,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
44 | [Test] | 44 | [Test] |
45 | public void TestConcatenateString() | 45 | public void TestConcatenateString() |
46 | { | 46 | { |
47 | LSL_Types.list testList = new LSL_Types.list(1, 'a', "test"); | 47 | LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test")); |
48 | testList += "addition"; | 48 | testList += new LSL_Types.LSLString("addition"); |
49 | 49 | ||
50 | Assert.AreEqual(4, testList.Length); | 50 | Assert.AreEqual(4, testList.Length); |
51 | Assert.AreEqual("addition", testList.Data[3]); | 51 | Assert.AreEqual(new LSL_Types.LSLString("addition"), testList.Data[3]); |
52 | Assert.AreEqual(typeof(System.String), testList.Data[3].GetType()); | 52 | Assert.AreEqual(typeof(LSL_Types.LSLString), testList.Data[3].GetType()); |
53 | 53 | ||
54 | LSL_Types.list secondTestList = testList + "more"; | 54 | LSL_Types.list secondTestList = testList + new LSL_Types.LSLString("more"); |
55 | 55 | ||
56 | Assert.AreEqual(5, secondTestList.Length); | 56 | Assert.AreEqual(5, secondTestList.Length); |
57 | Assert.AreEqual("more", secondTestList.Data[4]); | 57 | Assert.AreEqual(new LSL_Types.LSLString("more"), secondTestList.Data[4]); |
58 | Assert.AreEqual(typeof(System.String), secondTestList.Data[4].GetType()); | 58 | Assert.AreEqual(typeof(LSL_Types.LSLString), secondTestList.Data[4].GetType()); |
59 | } | 59 | } |
60 | 60 | ||
61 | /// <summary> | 61 | /// <summary> |
@@ -64,38 +64,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
64 | [Test] | 64 | [Test] |
65 | public void TestConcatenateInteger() | 65 | public void TestConcatenateInteger() |
66 | { | 66 | { |
67 | LSL_Types.list testList = new LSL_Types.list(1, 'a', "test"); | 67 | LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test")); |
68 | testList += 20; | 68 | testList += new LSL_Types.LSLInteger(20); |
69 | 69 | ||
70 | Assert.AreEqual(4, testList.Length); | 70 | Assert.AreEqual(4, testList.Length); |
71 | Assert.AreEqual(20, testList.Data[3]); | 71 | Assert.AreEqual(new LSL_Types.LSLInteger(20), testList.Data[3]); |
72 | Assert.AreEqual(typeof(int), testList.Data[3].GetType()); | 72 | Assert.AreEqual(typeof(LSL_Types.LSLInteger), testList.Data[3].GetType()); |
73 | 73 | ||
74 | LSL_Types.list secondTestList = testList + 2; | 74 | LSL_Types.list secondTestList = testList + new LSL_Types.LSLInteger(2); |
75 | 75 | ||
76 | Assert.AreEqual(5, secondTestList.Length); | 76 | Assert.AreEqual(5, secondTestList.Length); |
77 | Assert.AreEqual(2, secondTestList.Data[4]); | 77 | Assert.AreEqual(new LSL_Types.LSLInteger(2), secondTestList.Data[4]); |
78 | Assert.AreEqual(typeof(int), secondTestList.Data[4].GetType()); | 78 | Assert.AreEqual(typeof(LSL_Types.LSLInteger), secondTestList.Data[4].GetType()); |
79 | } | 79 | } |
80 | 80 | ||
81 | /// <summary> | 81 | /// <summary> |
82 | /// Tests concatenating a double to a list. | 82 | /// Tests concatenating a float to a list. |
83 | /// </summary> | 83 | /// </summary> |
84 | [Test] | 84 | [Test] |
85 | public void TestConcatenateDouble() | 85 | public void TestConcatenateDouble() |
86 | { | 86 | { |
87 | LSL_Types.list testList = new LSL_Types.list(1, 'a', "test"); | 87 | LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test")); |
88 | testList += 2.0; | 88 | testList += new LSL_Types.LSLFloat(2.0f); |
89 | 89 | ||
90 | Assert.AreEqual(4, testList.Length); | 90 | Assert.AreEqual(4, testList.Length); |
91 | Assert.AreEqual(2.0, testList.Data[3]); | 91 | Assert.AreEqual(new LSL_Types.LSLFloat(2.0f), testList.Data[3]); |
92 | Assert.AreEqual(typeof(double), testList.Data[3].GetType()); | 92 | Assert.AreEqual(typeof(LSL_Types.LSLFloat), testList.Data[3].GetType()); |
93 | 93 | ||
94 | LSL_Types.list secondTestList = testList + 0.04; | 94 | LSL_Types.list secondTestList = testList + new LSL_Types.LSLFloat(0.04f); |
95 | 95 | ||
96 | Assert.AreEqual(5, secondTestList.Length); | 96 | Assert.AreEqual(5, secondTestList.Length); |
97 | Assert.AreEqual(0.04, secondTestList.Data[4]); | 97 | Assert.AreEqual(new LSL_Types.LSLFloat(0.04f), secondTestList.Data[4]); |
98 | Assert.AreEqual(typeof(double), secondTestList.Data[4].GetType()); | 98 | Assert.AreEqual(typeof(LSL_Types.LSLFloat), secondTestList.Data[4].GetType()); |
99 | } | 99 | } |
100 | 100 | ||
101 | /// <summary> | 101 | /// <summary> |