aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-23 13:28:17 +0000
committerMelanie Thielker2008-09-23 13:28:17 +0000
commitd95794d05c8e98877189c9c6b306110a9fc2df59 (patch)
treee35c78dd6241b947d7249d3a4699ef9859ca8839 /OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests
parentAdd file missed in last commit (which never completed) (diff)
downloadopensim-SC_OLD-d95794d05c8e98877189c9c6b306110a9fc2df59.zip
opensim-SC_OLD-d95794d05c8e98877189c9c6b306110a9fc2df59.tar.gz
opensim-SC_OLD-d95794d05c8e98877189c9c6b306110a9fc2df59.tar.bz2
opensim-SC_OLD-d95794d05c8e98877189c9c6b306110a9fc2df59.tar.xz
Refactor XEngine parser as per suggestions from mikem
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs
index fefcada..4e2766c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CSCodeGeneratorTest.cs
@@ -124,7 +124,7 @@ state another_state
124 string expected = 124 string expected =
125 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + 125 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" +
126 "\n {" + 126 "\n {" +
127 "\n LSL_Types.LSLInteger x = 0;" + 127 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(0);" +
128 "\n }\n"; 128 "\n }\n";
129 129
130 CSCodeGenerator cg = new CSCodeGenerator(); 130 CSCodeGenerator cg = new CSCodeGenerator();
@@ -148,7 +148,7 @@ state another_state
148 string expected = 148 string expected =
149 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + 149 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" +
150 "\n {" + 150 "\n {" +
151 "\n LSL_Types.LSLString y = \"\";" + 151 "\n LSL_Types.LSLString y = new LSL_Types.LSLString(\"\");" +
152 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(14);" + 152 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(14);" +
153 "\n y = new LSL_Types.LSLString(\"Hello\");" + 153 "\n y = new LSL_Types.LSLString(\"Hello\");" +
154 "\n }\n"; 154 "\n }\n";
@@ -235,7 +235,7 @@ state another_state
235 string expected = 235 string expected =
236 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + 236 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" +
237 "\n {" + 237 "\n {" +
238 "\n LSL_Types.LSLInteger y = 0;" + 238 "\n LSL_Types.LSLInteger y = new LSL_Types.LSLInteger(0);" +
239 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(14) + new LSL_Types.LSLInteger(6);" + 239 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(14) + new LSL_Types.LSLInteger(6);" +
240 "\n y = new LSL_Types.LSLInteger(12) - new LSL_Types.LSLInteger(3);" + 240 "\n y = new LSL_Types.LSLInteger(12) - new LSL_Types.LSLInteger(3);" +
241 "\n y = new LSL_Types.LSLInteger(12) * new LSL_Types.LSLInteger(3);" + 241 "\n y = new LSL_Types.LSLInteger(12) * new LSL_Types.LSLInteger(3);" +
@@ -440,7 +440,7 @@ default
440} 440}
441"; 441";
442 string expected = 442 string expected =
443 "\n LSL_Types.LSLString globalString = \"\";" + 443 "\n LSL_Types.LSLString globalString = new LSL_Types.LSLString(\"\");" +
444 "\n LSL_Types.LSLInteger globalInt = new LSL_Types.LSLInteger(14);" + 444 "\n LSL_Types.LSLInteger globalInt = new LSL_Types.LSLInteger(14);" +
445 "\n LSL_Types.LSLInteger anotherGlobal = new LSL_Types.LSLInteger(20) * globalInt;" + 445 "\n LSL_Types.LSLInteger anotherGlobal = new LSL_Types.LSLInteger(20) * globalInt;" +
446 "\n LSL_Types.LSLString onefunc()" + 446 "\n LSL_Types.LSLString onefunc()" +
@@ -495,7 +495,7 @@ default
495} 495}
496"; 496";
497 string expected = 497 string expected =
498 "\n LSL_Types.LSLString globalString = \"\";" + 498 "\n LSL_Types.LSLString globalString = new LSL_Types.LSLString(\"\");" +
499 "\n LSL_Types.LSLInteger globalInt = new LSL_Types.LSLInteger(14);" + 499 "\n LSL_Types.LSLInteger globalInt = new LSL_Types.LSLInteger(14);" +
500 "\n LSL_Types.LSLString onefunc(LSL_Types.LSLString addition)" + 500 "\n LSL_Types.LSLString onefunc(LSL_Types.LSLString addition)" +
501 "\n {" + 501 "\n {" +
@@ -1251,19 +1251,19 @@ default
1251 string expected = 1251 string expected =
1252 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + 1252 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" +
1253 "\n {" + 1253 "\n {" +
1254 "\n LSL_Types.LSLInteger i = 0;" + 1254 "\n LSL_Types.LSLInteger i = new LSL_Types.LSLInteger(0);" +
1255 "\n LSL_Types.LSLInteger j = new LSL_Types.LSLInteger(14);" + 1255 "\n LSL_Types.LSLInteger j = new LSL_Types.LSLInteger(14);" +
1256 "\n LSL_Types.LSLFloat f = 0.0;" + 1256 "\n LSL_Types.LSLFloat f = new LSL_Types.LSLFloat(0.0);" +
1257 "\n LSL_Types.LSLFloat g = new LSL_Types.LSLFloat(14.0);" + 1257 "\n LSL_Types.LSLFloat g = new LSL_Types.LSLFloat(14.0);" +
1258 "\n LSL_Types.LSLString s = \"\";" + 1258 "\n LSL_Types.LSLString s = new LSL_Types.LSLString(\"\");" +
1259 "\n LSL_Types.LSLString t = new LSL_Types.LSLString(\"Hi there\");" + 1259 "\n LSL_Types.LSLString t = new LSL_Types.LSLString(\"Hi there\");" +
1260 "\n LSL_Types.list l = new LSL_Types.list();" + 1260 "\n LSL_Types.list l = new LSL_Types.list();" +
1261 "\n LSL_Types.list m = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger(2), new LSL_Types.LSLInteger(3));" + 1261 "\n LSL_Types.list m = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger(2), new LSL_Types.LSLInteger(3));" +
1262 "\n LSL_Types.Vector3 v = new LSL_Types.Vector3(0.0, 0.0, 0.0);" + 1262 "\n LSL_Types.Vector3 v = new LSL_Types.Vector3(new LSL_Types.LSLFloat(0.0), new LSL_Types.LSLFloat(0.0), new LSL_Types.LSLFloat(0.0));" +
1263 "\n LSL_Types.Vector3 w = new LSL_Types.Vector3(new LSL_Types.LSLFloat(1.0), new LSL_Types.LSLFloat(0.1), new LSL_Types.LSLFloat(0.5));" + 1263 "\n LSL_Types.Vector3 w = new LSL_Types.Vector3(new LSL_Types.LSLFloat(1.0), new LSL_Types.LSLFloat(0.1), new LSL_Types.LSLFloat(0.5));" +
1264 "\n LSL_Types.Quaternion r = new LSL_Types.Quaternion(0.0, 0.0, 0.0, 0.0);" + 1264 "\n LSL_Types.Quaternion r = new LSL_Types.Quaternion(new LSL_Types.LSLFloat(0.0), new LSL_Types.LSLFloat(0.0), new LSL_Types.LSLFloat(0.0), new LSL_Types.LSLFloat(0.0));" +
1265 "\n LSL_Types.Quaternion u = new LSL_Types.Quaternion(new LSL_Types.LSLFloat(0.8), new LSL_Types.LSLFloat(0.7), new LSL_Types.LSLFloat(0.6), llSomeFunc());" + 1265 "\n LSL_Types.Quaternion u = new LSL_Types.Quaternion(new LSL_Types.LSLFloat(0.8), new LSL_Types.LSLFloat(0.7), new LSL_Types.LSLFloat(0.6), llSomeFunc());" +
1266 "\n LSL_Types.LSLString k = \"\";" + 1266 "\n LSL_Types.LSLString k = new LSL_Types.LSLString(\"\");" +
1267 "\n LSL_Types.LSLString n = new LSL_Types.LSLString(\"ping\");" + 1267 "\n LSL_Types.LSLString n = new LSL_Types.LSLString(\"ping\");" +
1268 "\n }\n"; 1268 "\n }\n";
1269 1269
@@ -1292,8 +1292,8 @@ default
1292 string expected = 1292 string expected =
1293 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" + 1293 "\n public void default_event_touch_start(LSL_Types.LSLInteger num_detected)" +
1294 "\n {" + 1294 "\n {" +
1295 "\n LSL_Types.LSLInteger x = 0;" + 1295 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(0);" +
1296 "\n LSL_Types.LSLInteger y = 0;" + 1296 "\n LSL_Types.LSLInteger y = new LSL_Types.LSLInteger(0);" +
1297 "\n x = y = new LSL_Types.LSLInteger(5);" + 1297 "\n x = y = new LSL_Types.LSLInteger(5);" +
1298 "\n x += y -= new LSL_Types.LSLInteger(5);" + 1298 "\n x += y -= new LSL_Types.LSLInteger(5);" +
1299 "\n llOwnerSay(new LSL_Types.LSLString(\"x is: \") + (LSL_Types.LSLString) (x) + new LSL_Types.LSLString(\", y is: \") + (LSL_Types.LSLString) (y));" + 1299 "\n llOwnerSay(new LSL_Types.LSLString(\"x is: \") + (LSL_Types.LSLString) (x) + new LSL_Types.LSLString(\", y is: \") + (LSL_Types.LSLString) (y));" +
@@ -1504,7 +1504,7 @@ default
1504 string expected = 1504 string expected =
1505 "\n public void default_event_state_entry()" + 1505 "\n public void default_event_state_entry()" +
1506 "\n {" + 1506 "\n {" +
1507 "\n LSL_Types.LSLInteger x = 0;" + 1507 "\n LSL_Types.LSLInteger x = new LSL_Types.LSLInteger(0);" +
1508 "\n while (x = new LSL_Types.LSLInteger(14))" + 1508 "\n while (x = new LSL_Types.LSLInteger(14))" +
1509 "\n llOwnerSay(new LSL_Types.LSLString(\"x is: \") + (LSL_Types.LSLString) (x));" + 1509 "\n llOwnerSay(new LSL_Types.LSLString(\"x is: \") + (LSL_Types.LSLString) (x));" +
1510 "\n if (x = new LSL_Types.LSLInteger(24))" + 1510 "\n if (x = new LSL_Types.LSLInteger(24))" +