mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-02 08:08:20 +00:00
Add the new test suite.
This test suite has been in use for a long time now, in place of the obsolete and unmanageable testparser.py and testfuncs.py. It verifies the complete optimizer output to stdout and stderr, to ensure that the output matches the expectations. See unit_tests/README.txt for more info.
This commit is contained in:
parent
7fbde0269c
commit
1867dc78e7
547 changed files with 11680 additions and 0 deletions
9
unit_tests/regression.suite/assign-x-to-x.lsl
Normal file
9
unit_tests/regression.suite/assign-x-to-x.lsl
Normal file
|
@ -0,0 +1,9 @@
|
|||
default{timer(){
|
||||
|
||||
integer a = llGetLinkNumber();
|
||||
integer b = a = a;
|
||||
a = a = b = b;
|
||||
|
||||
llOwnerSay((string)(++b));
|
||||
|
||||
}}
|
10
unit_tests/regression.suite/assign-x-to-x.out
Normal file
10
unit_tests/regression.suite/assign-x-to-x.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
integer a = llGetLinkNumber();
|
||||
integer b = a;
|
||||
a = b;
|
||||
llOwnerSay((string)(++b));
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/assign-x-to-x.run
Normal file
1
unit_tests/regression.suite/assign-x-to-x.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py - -O -dcr
|
12
unit_tests/regression.suite/bitshift.lsl
Normal file
12
unit_tests/regression.suite/bitshift.lsl
Normal file
|
@ -0,0 +1,12 @@
|
|||
default{timer(){
|
||||
|
||||
integer x = 1;
|
||||
integer y = x << 31;
|
||||
integer z = (integer)-0x80000000;
|
||||
|
||||
llOwnerSay((string)y);
|
||||
z += 1;
|
||||
y += 1;
|
||||
x += 1;
|
||||
|
||||
}}
|
13
unit_tests/regression.suite/bitshift.out
Normal file
13
unit_tests/regression.suite/bitshift.out
Normal file
|
@ -0,0 +1,13 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
integer x = 1;
|
||||
integer y = x * ((integer)-2147483648);
|
||||
integer z = ((integer)-2147483648);
|
||||
llOwnerSay((string)y);
|
||||
z = -~z;
|
||||
y = -~y;
|
||||
x = -~x;
|
||||
}
|
||||
}
|
10
unit_tests/regression.suite/bitwise.lsl
Normal file
10
unit_tests/regression.suite/bitwise.lsl
Normal file
|
@ -0,0 +1,10 @@
|
|||
default{timer(){
|
||||
integer a = llGetUnixTime();
|
||||
|
||||
llBreakLink(a & 3 | a & 5);
|
||||
llBreakLink((a | 3) & (a | 5));
|
||||
llBreakLink(a | (a & 5));
|
||||
llBreakLink(llGetAgentInfo(llGetOwner()) | (llGetAgentInfo(llGetOwner()) & 5));
|
||||
llBreakLink(llGetAgentInfo(llGetOwner()) & 3 | llGetAgentInfo(llGetOwner()) & 5);
|
||||
llBreakLink(llGetAgentInfo(llGetOwner()) & 2 && llGetAgentInfo(llGetOwner()) & 4);
|
||||
}}
|
13
unit_tests/regression.suite/bitwise.out
Normal file
13
unit_tests/regression.suite/bitwise.out
Normal file
|
@ -0,0 +1,13 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
integer a = llGetUnixTime();
|
||||
llBreakLink(a & 7);
|
||||
llBreakLink(a | 1);
|
||||
llBreakLink(a);
|
||||
llBreakLink(llGetAgentInfo(llGetOwner()));
|
||||
llBreakLink(llGetAgentInfo(llGetOwner()) & 7);
|
||||
llBreakLink(!~(llGetAgentInfo(llGetOwner()) | ((integer)-7)));
|
||||
}
|
||||
}
|
15
unit_tests/regression.suite/boolean-and.lsl
Normal file
15
unit_tests/regression.suite/boolean-and.lsl
Normal file
|
@ -0,0 +1,15 @@
|
|||
default{timer(){
|
||||
string s = llGetObjectDesc();
|
||||
key k = llGenerateKey();
|
||||
integer i = llGetLinkNumber();
|
||||
|
||||
if (s == "A" && k != llGenerateKey() && !~llSubStringIndex(s, "B"))
|
||||
llDie();
|
||||
/* Chance for a future optimization - this is always false */
|
||||
if (i == 5 && i == 9 && llGetLinkNumber())
|
||||
llDie();
|
||||
if (i != 5 && i != 9 && llGetLinkNumber())
|
||||
llDie();
|
||||
if (1 & i == 5 && i == 7 && i == 9 && llGetLinkNumber())
|
||||
llDie();
|
||||
}}
|
17
unit_tests/regression.suite/boolean-and.out
Normal file
17
unit_tests/regression.suite/boolean-and.out
Normal file
|
@ -0,0 +1,17 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
string s = llGetObjectDesc();
|
||||
key k = llGenerateKey();
|
||||
integer i = llGetLinkNumber();
|
||||
if (!((!(s == "A")) | k == llGenerateKey() | (~llSubStringIndex(s, "B"))))
|
||||
llDie();
|
||||
if (-!(i ^ 5 | i ^ 9) & llGetLinkNumber())
|
||||
llDie();
|
||||
if (-!(i == 5 | i == 9) & llGetLinkNumber())
|
||||
llDie();
|
||||
if (-!(i ^ 5 | i ^ 7 | i ^ 9) & llGetLinkNumber())
|
||||
llDie();
|
||||
}
|
||||
}
|
10
unit_tests/regression.suite/boolexpr.lsl
Normal file
10
unit_tests/regression.suite/boolexpr.lsl
Normal file
|
@ -0,0 +1,10 @@
|
|||
default{touch(integer n){
|
||||
|
||||
if (llSameGroup(llGetOwner()) && llDetectedGroup(0)) llDie();
|
||||
|
||||
// TODO
|
||||
// llGetEnergy() has min=0 and max=1, therefore (integer)llGetEnergy() is bool,
|
||||
// however we don't yet handle it.
|
||||
if ((integer)llGetEnergy() && llSameGroup(llGetOwner())) llDie();
|
||||
|
||||
}}
|
10
unit_tests/regression.suite/boolexpr.out
Normal file
10
unit_tests/regression.suite/boolexpr.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
default
|
||||
{
|
||||
touch(integer n)
|
||||
{
|
||||
if (llSameGroup(llGetOwner()) & llDetectedGroup(0))
|
||||
llDie();
|
||||
if ((integer)llGetEnergy() & -llSameGroup(llGetOwner()))
|
||||
llDie();
|
||||
}
|
||||
}
|
27
unit_tests/regression.suite/breakcont-n.lsl
Normal file
27
unit_tests/regression.suite/breakcont-n.lsl
Normal file
|
@ -0,0 +1,27 @@
|
|||
//Sei's test break/continue
|
||||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
integer i = 0;
|
||||
while (i < 10)
|
||||
{
|
||||
integer j = 0;
|
||||
while (j < 10)
|
||||
{
|
||||
if (j == 5)
|
||||
break 2;
|
||||
if (j == 6)
|
||||
continue 2;
|
||||
if (j == 7)
|
||||
break;
|
||||
if (j == 8)
|
||||
continue;
|
||||
++j;
|
||||
}
|
||||
++i;
|
||||
if (llFrand(5) < 3)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
34
unit_tests/regression.suite/breakcont-n.out
Normal file
34
unit_tests/regression.suite/breakcont-n.out
Normal file
|
@ -0,0 +1,34 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
integer i = 0;
|
||||
{
|
||||
while (i < 10)
|
||||
{
|
||||
integer j = 0;
|
||||
{
|
||||
while (j < 10)
|
||||
{
|
||||
if (j == 5)
|
||||
jump J_autoGen00001;
|
||||
if (j == 6)
|
||||
jump J_autoGen00002;
|
||||
if (j == 7)
|
||||
jump J_autoGen00003;
|
||||
if (j == 8)
|
||||
jump J_autoGen00004;
|
||||
++j;
|
||||
@J_autoGen00004;
|
||||
}
|
||||
@J_autoGen00003;
|
||||
}
|
||||
++i;
|
||||
if (llFrand(5) < 3)
|
||||
jump J_autoGen00001;
|
||||
@J_autoGen00002;
|
||||
}
|
||||
@J_autoGen00001;
|
||||
}
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/breakcont-n.run
Normal file
1
unit_tests/regression.suite/breakcont-n.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O clear,breakcont -
|
11
unit_tests/regression.suite/cast-checks-1.lsl
Normal file
11
unit_tests/regression.suite/cast-checks-1.lsl
Normal file
|
@ -0,0 +1,11 @@
|
|||
default{timer(){
|
||||
|
||||
(integer)1;
|
||||
(float)2.0;
|
||||
(string)"abc";
|
||||
(key)NULL_KEY;
|
||||
(vector)<1,2,3>;
|
||||
(rotation)<0,0,1,0>;
|
||||
(list)[1,2,3,4,5];
|
||||
|
||||
}}
|
19
unit_tests/regression.suite/cast-checks-1.out
Normal file
19
unit_tests/regression.suite/cast-checks-1.out
Normal file
|
@ -0,0 +1,19 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
(integer)1;
|
||||
(float)2.;
|
||||
(string)"abc";
|
||||
(key)"00000000-0000-0000-0000-000000000000";
|
||||
(vector)<1, 2, 3>;
|
||||
(rotation)<0, 0, 1, 0>;
|
||||
(list)
|
||||
[ 1
|
||||
, 2
|
||||
, 3
|
||||
, 4
|
||||
, 5
|
||||
];
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/cast-checks-1.run
Normal file
1
unit_tests/regression.suite/cast-checks-1.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O clear
|
3
unit_tests/regression.suite/cast-checks-2.err
Normal file
3
unit_tests/regression.suite/cast-checks-2.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
(vector)-<1,2,3>;
|
||||
^
|
||||
(Line 3 char 10): ERROR: Syntax error
|
6
unit_tests/regression.suite/cast-checks-2.lsl
Normal file
6
unit_tests/regression.suite/cast-checks-2.lsl
Normal file
|
@ -0,0 +1,6 @@
|
|||
default{timer(){
|
||||
|
||||
(vector)-<1,2,3>;
|
||||
|
||||
}}
|
||||
|
1
unit_tests/regression.suite/cast-checks-2.run
Normal file
1
unit_tests/regression.suite/cast-checks-2.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O clear
|
3
unit_tests/regression.suite/cast-checks-3.err
Normal file
3
unit_tests/regression.suite/cast-checks-3.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
(list)-[1,2,3,4,5];
|
||||
^
|
||||
(Line 3 char 8): ERROR: Syntax error
|
6
unit_tests/regression.suite/cast-checks-3.lsl
Normal file
6
unit_tests/regression.suite/cast-checks-3.lsl
Normal file
|
@ -0,0 +1,6 @@
|
|||
default{timer(){
|
||||
|
||||
(list)-[1,2,3,4,5];
|
||||
|
||||
}}
|
||||
|
1
unit_tests/regression.suite/cast-checks-3.run
Normal file
1
unit_tests/regression.suite/cast-checks-3.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O clear
|
3
unit_tests/regression.suite/cast-checks-4.err
Normal file
3
unit_tests/regression.suite/cast-checks-4.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
(vector)-ZERO_VECTOR;
|
||||
^
|
||||
(Line 3 char 10): ERROR: Syntax error
|
5
unit_tests/regression.suite/cast-checks-4.lsl
Normal file
5
unit_tests/regression.suite/cast-checks-4.lsl
Normal file
|
@ -0,0 +1,5 @@
|
|||
default{timer(){
|
||||
|
||||
(vector)-ZERO_VECTOR;
|
||||
|
||||
}}
|
1
unit_tests/regression.suite/cast-checks-4.run
Normal file
1
unit_tests/regression.suite/cast-checks-4.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O clear
|
8
unit_tests/regression.suite/cast-checks-5.lsl
Normal file
8
unit_tests/regression.suite/cast-checks-5.lsl
Normal file
|
@ -0,0 +1,8 @@
|
|||
default{timer(){
|
||||
|
||||
key k;
|
||||
string s;
|
||||
s == k;
|
||||
k == s;
|
||||
|
||||
}}
|
10
unit_tests/regression.suite/cast-checks-5.out
Normal file
10
unit_tests/regression.suite/cast-checks-5.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
key k;
|
||||
string s;
|
||||
(key)s == k;
|
||||
(string)k == s;
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/cast-checks-5.run
Normal file
1
unit_tests/regression.suite/cast-checks-5.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O clear,explicitcast
|
14
unit_tests/regression.suite/cast-list2xxx-explicit.lsl
Normal file
14
unit_tests/regression.suite/cast-list2xxx-explicit.lsl
Normal file
|
@ -0,0 +1,14 @@
|
|||
default{timer(){
|
||||
|
||||
list L = llDeleteSubList(llGetPhysicsMaterial(), 0, -1)
|
||||
+ [3];
|
||||
|
||||
// this should produce (key)"3" -> can't be switched to llList2Key
|
||||
key a = llList2String(L, 0);
|
||||
|
||||
// this should produce "" -> can't be switched to llList2String
|
||||
string b = llList2Key(L, 0);
|
||||
|
||||
llParticleSystem([a,b]);
|
||||
|
||||
}}
|
10
unit_tests/regression.suite/cast-list2xxx-explicit.out
Normal file
10
unit_tests/regression.suite/cast-list2xxx-explicit.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
list L = (list)3;
|
||||
key a = (key)llList2String(L, 0);
|
||||
string b = (string)llList2Key(L, 0);
|
||||
llParticleSystem((list)a + b);
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/cast-list2xxx-explicit.run
Normal file
1
unit_tests/regression.suite/cast-list2xxx-explicit.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O explicitcast -
|
29
unit_tests/regression.suite/cast-list2xxx.lsl
Normal file
29
unit_tests/regression.suite/cast-list2xxx.lsl
Normal file
|
@ -0,0 +1,29 @@
|
|||
default{timer(){
|
||||
|
||||
list L = llDeleteSubList(llGetPhysicsMaterial(), 0, 99999)
|
||||
+ [0.9999997, 0.000111222, 2, 2147483647];
|
||||
|
||||
// this returns 1, but llList2Integer returns 0
|
||||
integer a = (integer)llList2String(L, 0);
|
||||
|
||||
// this returns 0.000111, but llList2Float returns 0.000111222
|
||||
float b = (float)llList2String(L, 1);
|
||||
|
||||
// test consistency
|
||||
string c = (string)llList2String(L, 0);
|
||||
|
||||
// this returns (key)"2", but llList2Key returns (key)""
|
||||
key d = (key)llList2String(L, 2);
|
||||
|
||||
// same as above, the typecast is implicit
|
||||
key e = llList2String(L, 2);
|
||||
|
||||
// this returns 0, but llList2Float would return 0.000111222
|
||||
float f = (float)llList2Integer(L, 1);
|
||||
|
||||
// this returns -2147483648, but llList2Integer returns 2147483647
|
||||
integer g = (integer)llList2Float(L, 3);
|
||||
|
||||
llParticleSystem([a,b,c,d,e]);
|
||||
|
||||
}}
|
13
unit_tests/regression.suite/cast-list2xxx.out
Normal file
13
unit_tests/regression.suite/cast-list2xxx.out
Normal file
|
@ -0,0 +1,13 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
list L = llDeleteSubList(llGetPhysicsMaterial(), 0, 99999) + 0.9999997 + 0.000111222 + 2 + 2147483647;
|
||||
integer a = (integer)llList2String(L, 0);
|
||||
float b = (float)llList2String(L, 1);
|
||||
string c = llList2String(L, 0);
|
||||
key d = (key)llList2String(L, 2);
|
||||
key e = llList2String(L, 2);
|
||||
llParticleSystem((list)a + b + c + d + e);
|
||||
}
|
||||
}
|
6
unit_tests/regression.suite/chained-assignment.lsl
Normal file
6
unit_tests/regression.suite/chained-assignment.lsl
Normal file
|
@ -0,0 +1,6 @@
|
|||
default{timer(){
|
||||
|
||||
integer a;
|
||||
integer b = a = a = a = 3;
|
||||
|
||||
}}
|
8
unit_tests/regression.suite/chained-assignment.out
Normal file
8
unit_tests/regression.suite/chained-assignment.out
Normal file
|
@ -0,0 +1,8 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
integer a;
|
||||
integer b = a = a = a = 3;
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/chained-assignment.run
Normal file
1
unit_tests/regression.suite/chained-assignment.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py - -O clear
|
16
unit_tests/regression.suite/comparetrees.lsl
Normal file
16
unit_tests/regression.suite/comparetrees.lsl
Normal file
|
@ -0,0 +1,16 @@
|
|||
default{timer(){
|
||||
|
||||
// Stable function
|
||||
if (llGetPermissions() & 2 || llGetPermissions() & 4) llDie();
|
||||
|
||||
// Unstable function
|
||||
if (llGetUsedMemory() & 2 || llGetUsedMemory() & 4) llDie();
|
||||
|
||||
// Stable function with typecast
|
||||
if ((integer)llGetTime() == (integer)llGetTime()) llDie();
|
||||
if ((integer)llGetTime() != (integer)llGetTime()) llDie();
|
||||
|
||||
// Unstable function with typecast
|
||||
if ((integer)llFrand(2) == (integer)llFrand(2)) llDie();
|
||||
|
||||
}}
|
13
unit_tests/regression.suite/comparetrees.out
Normal file
13
unit_tests/regression.suite/comparetrees.out
Normal file
|
@ -0,0 +1,13 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
if (llGetPermissions() & 6)
|
||||
llDie();
|
||||
if (llGetUsedMemory() & 2 | llGetUsedMemory() & 4)
|
||||
llDie();
|
||||
llDie();
|
||||
if ((integer)llFrand(2) == (integer)llFrand(2))
|
||||
llDie();
|
||||
}
|
||||
}
|
41
unit_tests/regression.suite/comparison-min-max.lsl
Normal file
41
unit_tests/regression.suite/comparison-min-max.lsl
Normal file
|
@ -0,0 +1,41 @@
|
|||
default
|
||||
{
|
||||
changed(integer ch)
|
||||
{
|
||||
if (llListFindList(llGetPrimitiveParams([PRIM_TYPE]), ["a"]) < 0)
|
||||
llDie();
|
||||
|
||||
if (llSameGroup(llGetOwner()) < -3)
|
||||
llOwnerSay("a");
|
||||
if (llSameGroup(llGetOwner()) < -2)
|
||||
llOwnerSay("b");
|
||||
if (llSameGroup(llGetOwner()) < -1)
|
||||
llOwnerSay("c");
|
||||
if (llSameGroup(llGetOwner()) < 0)
|
||||
llOwnerSay("d");
|
||||
if (llSameGroup(llGetOwner()) < 1)
|
||||
llOwnerSay("e");
|
||||
if (llSameGroup(llGetOwner()) < 2)
|
||||
llOwnerSay("f");
|
||||
if (llSameGroup(llGetOwner()) < 3)
|
||||
llOwnerSay("g");
|
||||
if (llSameGroup(llGetOwner()) < 4)
|
||||
llOwnerSay("h");
|
||||
if (llSameGroup(llGetOwner()) > -3)
|
||||
llOwnerSay("A");
|
||||
if (llSameGroup(llGetOwner()) > -2)
|
||||
llOwnerSay("B");
|
||||
if (llSameGroup(llGetOwner()) > -1)
|
||||
llOwnerSay("C");
|
||||
if (llSameGroup(llGetOwner()) > 0)
|
||||
llOwnerSay("D");
|
||||
if (llSameGroup(llGetOwner()) > 1)
|
||||
llOwnerSay("E");
|
||||
if (llSameGroup(llGetOwner()) > 2)
|
||||
llOwnerSay("F");
|
||||
if (llSameGroup(llGetOwner()) > 3)
|
||||
llOwnerSay("G");
|
||||
if (llSameGroup(llGetOwner()) > 4)
|
||||
llOwnerSay("H");
|
||||
}
|
||||
}
|
18
unit_tests/regression.suite/comparison-min-max.out
Normal file
18
unit_tests/regression.suite/comparison-min-max.out
Normal file
|
@ -0,0 +1,18 @@
|
|||
default
|
||||
{
|
||||
changed(integer ch)
|
||||
{
|
||||
if (~llListFindList(llGetPrimitiveParams((list)9), (list)"a"))
|
||||
llDie();
|
||||
if (!llSameGroup(llGetOwner()))
|
||||
llOwnerSay("e");
|
||||
llOwnerSay("f");
|
||||
llOwnerSay("g");
|
||||
llOwnerSay("h");
|
||||
llOwnerSay("A");
|
||||
llOwnerSay("B");
|
||||
llOwnerSay("C");
|
||||
if (llSameGroup(llGetOwner()))
|
||||
llOwnerSay("D");
|
||||
}
|
||||
}
|
19
unit_tests/regression.suite/comparisons.lsl
Normal file
19
unit_tests/regression.suite/comparisons.lsl
Normal file
|
@ -0,0 +1,19 @@
|
|||
default{timer(){
|
||||
|
||||
integer a = (integer)llFrand(100);
|
||||
integer b = (integer)llFrand(100);
|
||||
llParticleSystem([
|
||||
!(a - 1),
|
||||
!(a ^ 1),
|
||||
!(a != 1),
|
||||
!(a == 2),
|
||||
!(a - 3),
|
||||
!(a + -3),
|
||||
!(a + 3),
|
||||
!(a + -b),
|
||||
!(-a + b),
|
||||
!(a + b),
|
||||
-a == -b,
|
||||
""]);
|
||||
|
||||
}}
|
22
unit_tests/regression.suite/comparisons.out
Normal file
22
unit_tests/regression.suite/comparisons.out
Normal file
|
@ -0,0 +1,22 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
integer a = (integer)llFrand(100);
|
||||
integer b = (integer)llFrand(100);
|
||||
llParticleSystem(
|
||||
[ !~-a
|
||||
, !~-a
|
||||
, !~-a
|
||||
, !(a == 2)
|
||||
, 3 == a
|
||||
, 3 == a
|
||||
, ((integer)-3) == a
|
||||
, a == b
|
||||
, a == b
|
||||
, -a == b
|
||||
, a == b
|
||||
, ""
|
||||
]);
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/comparisons.run
Normal file
1
unit_tests/regression.suite/comparisons.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O -listadd,-dcr
|
33
unit_tests/regression.suite/computable.lsl
Normal file
33
unit_tests/regression.suite/computable.lsl
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Functions for which certain parameters produce predictable results.
|
||||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
llSetPrimitiveParams( // won't be optimized out because it has side effects
|
||||
[ llFrand(0.0)
|
||||
, llFrand(-0.0)
|
||||
, llFrand(1.4e-45)
|
||||
, llFrand(-1.4e-45)
|
||||
, llFrand(1.1754942e-38) // denormal - loses 1 bit precision
|
||||
, llFrand(1e40)
|
||||
, llFrand(-1e40)
|
||||
, llFrand(1e40*0)
|
||||
, llFrand(-1e40*0)
|
||||
, llCloud(<0,1,2>)
|
||||
, llAvatarOnLinkSitTarget(256)
|
||||
, llEdgeOfWorld(<0,1,2>,<0,0,1>)
|
||||
, llGetAgentInfo(".")
|
||||
, llGetAgentLanguage("")
|
||||
, llGetAgentList(3, [])
|
||||
, llGetAgentSize(NULL_KEY)
|
||||
, llGetAlpha(9)
|
||||
, llGetAnimation("0")
|
||||
, llGetAnimationList("")
|
||||
, llGetBoundingBox("")
|
||||
, llGetColor(9)
|
||||
, llGetDisplayName("")
|
||||
, llGetEnv("")
|
||||
, llGetEnv("yadda")
|
||||
]);
|
||||
}
|
||||
}
|
32
unit_tests/regression.suite/computable.out
Normal file
32
unit_tests/regression.suite/computable.out
Normal file
|
@ -0,0 +1,32 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ 0.
|
||||
, 0.
|
||||
, 0.
|
||||
, -0.
|
||||
, 0.
|
||||
, 0.
|
||||
, 0.
|
||||
, (1e40*0)
|
||||
, (-1e40*0)
|
||||
, 0.
|
||||
, ((key)"00000000-0000-0000-0000-000000000000")
|
||||
, 1
|
||||
, 0
|
||||
, ""
|
||||
, ["INVALID_SCOPE"]
|
||||
, <0., 0., 0.>
|
||||
, 1.
|
||||
, ""
|
||||
, []
|
||||
, []
|
||||
, <1., 1., 1.>
|
||||
, ""
|
||||
, ""
|
||||
, ""
|
||||
]);
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/computable.run
Normal file
1
unit_tests/regression.suite/computable.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O -dcr,addstrings,-optfloats,-listadd -
|
46
unit_tests/regression.suite/conditions.lsl
Normal file
46
unit_tests/regression.suite/conditions.lsl
Normal file
|
@ -0,0 +1,46 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
if ("") llOwnerSay("\"\"");
|
||||
if ("a") llOwnerSay("\"a\"");
|
||||
if ("ab") llOwnerSay("\"ab\"");
|
||||
if ((key)"") llOwnerSay("(key)\"\"");
|
||||
if ((key)NULL_KEY) llOwnerSay("(key)NULL_KEY");
|
||||
if ((key)TEXTURE_BLANK) llOwnerSay("(key)TEXTURE_BLANK");
|
||||
// check also upper-case key
|
||||
if ((key)"ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF") llOwnerSay("(key)\"ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF\"");
|
||||
if (<0,0,0>) llOwnerSay("<0,0,0>");
|
||||
if (<1,0,0>) llOwnerSay("<1,0,0>");
|
||||
if (<1e40*0,1e40*0,1e40*0>) llOwnerSay("<NaN,NaN,NaN>");
|
||||
if (<0,0,0,1>) llOwnerSay("<0,0,0,1>");
|
||||
if (<0,0,0,-1>) llOwnerSay("<0,0,0,-1>");
|
||||
if (<0,0,0,0>) llOwnerSay("<0,0,0,0>");
|
||||
if (<0,0,1,0>) llOwnerSay("<0,0,1,0>");
|
||||
if (3) llOwnerSay("3");
|
||||
if (0) llOwnerSay("0");
|
||||
if (3.) llOwnerSay("3.");
|
||||
if (0.) llOwnerSay("0.");
|
||||
if (1e40) llOwnerSay("inf");
|
||||
if (1e40*0) llOwnerSay("NaN");
|
||||
if ([]) llOwnerSay("[]");
|
||||
if ([""]) llOwnerSay("[\"\"]");
|
||||
if (["",""]) llOwnerSay("[\"\",\"\"]");
|
||||
if ((integer)llFrand(1)+1) llOwnerSay("(integer)llFrand(1)+1");
|
||||
if (llFrand(1)+1) llOwnerSay("llFrand(1)+1");
|
||||
if ((string)llFrand(1)) llOwnerSay("(string)llFrand(1)");
|
||||
if ((key)((string)llFrand(1))) llOwnerSay("(key)((string)llFrand(1))");
|
||||
if (<llFrand(1)+1,0,0>) llOwnerSay("<llFrand(1)+1,0,0>");
|
||||
if (<llFrand(1)+1,0,0,1>) llOwnerSay("<llFrand(1)+1,0,0,1>");
|
||||
if ([llFrand(1)]) llOwnerSay("[llFrand(1)]");
|
||||
|
||||
do llDie(); while (0);
|
||||
do llDie(); while (0.);
|
||||
do llDie(); while ("");
|
||||
do llDie(); while ((key)"");
|
||||
do llDie(); while (<0,0,0>);
|
||||
do llDie(); while ([]);
|
||||
do llDie(); while (<0,0,0,1>);
|
||||
do llDie(); while (<0,0,0,-1>);
|
||||
}
|
||||
}
|
45
unit_tests/regression.suite/conditions.out
Normal file
45
unit_tests/regression.suite/conditions.out
Normal file
|
@ -0,0 +1,45 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
llOwnerSay("\"a\"");
|
||||
llOwnerSay("\"ab\"");
|
||||
llOwnerSay("(key)TEXTURE_BLANK");
|
||||
llOwnerSay("(key)\"ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF\"");
|
||||
llOwnerSay("<1,0,0>");
|
||||
llOwnerSay("<NaN,NaN,NaN>");
|
||||
llOwnerSay("<0,0,0,-1>");
|
||||
llOwnerSay("<0,0,0,0>");
|
||||
llOwnerSay("<0,0,1,0>");
|
||||
llOwnerSay("3");
|
||||
llOwnerSay("3.");
|
||||
llOwnerSay("inf");
|
||||
llOwnerSay("NaN");
|
||||
llOwnerSay("[\"\"]");
|
||||
llOwnerSay("[\"\",\"\"]");
|
||||
if (~(integer)llFrand(1))
|
||||
llOwnerSay("(integer)llFrand(1)+1");
|
||||
if (!(1 + llFrand(1) == ((float)0)))
|
||||
llOwnerSay("llFrand(1)+1");
|
||||
if (!((string)llFrand(1) == ""))
|
||||
llOwnerSay("(string)llFrand(1)");
|
||||
if ((key)((string)llFrand(1)))
|
||||
llOwnerSay("(key)((string)llFrand(1))");
|
||||
if (!(<1 + llFrand(1), 0, 0> == <((float)0), ((float)0), ((float)0)>))
|
||||
llOwnerSay("<llFrand(1)+1,0,0>");
|
||||
if (!(<1 + llFrand(1), 0, 0, 1> == <((float)0), ((float)0), ((float)0), ((float)1)>))
|
||||
llOwnerSay("<llFrand(1)+1,0,0,1>");
|
||||
if ((list)llFrand(1) != [])
|
||||
llOwnerSay("[llFrand(1)]");
|
||||
llDie();
|
||||
llDie();
|
||||
llDie();
|
||||
llDie();
|
||||
llDie();
|
||||
llDie();
|
||||
llDie();
|
||||
do
|
||||
llDie();
|
||||
while (1);
|
||||
}
|
||||
}
|
7
unit_tests/regression.suite/declaration-chain-dcr.lsl
Normal file
7
unit_tests/regression.suite/declaration-chain-dcr.lsl
Normal file
|
@ -0,0 +1,7 @@
|
|||
default{state_entry(){
|
||||
integer a = 3;
|
||||
integer b = a;
|
||||
integer c = b;
|
||||
integer d = c;
|
||||
llOwnerSay("x" + (string)d);
|
||||
}}
|
7
unit_tests/regression.suite/declaration-chain-dcr.out
Normal file
7
unit_tests/regression.suite/declaration-chain-dcr.out
Normal file
|
@ -0,0 +1,7 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llOwnerSay("x" + "3");
|
||||
}
|
||||
}
|
80
unit_tests/regression.suite/detect-computable.lsl
Normal file
80
unit_tests/regression.suite/detect-computable.lsl
Normal file
|
@ -0,0 +1,80 @@
|
|||
// Test functions inside and outside a detection event that can be precomputed.
|
||||
default
|
||||
{
|
||||
// non-detection event
|
||||
state_entry()
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ llDetectedGrab(0)
|
||||
, llDetectedGroup(0)
|
||||
, llDetectedKey(0)
|
||||
, llDetectedLinkNumber(0)
|
||||
, llDetectedName(0)
|
||||
, llDetectedOwner(0)
|
||||
, llDetectedPos(0)
|
||||
, llDetectedRot(0)
|
||||
, llDetectedTouchBinormal(0)
|
||||
, llDetectedTouchFace(0)
|
||||
, llDetectedTouchNormal(0)
|
||||
, llDetectedTouchPos(0)
|
||||
, llDetectedTouchST(0)
|
||||
, llDetectedTouchUV(0)
|
||||
, llDetectedType(0)
|
||||
, llDetectedVel(0)
|
||||
]);
|
||||
}
|
||||
|
||||
// non-touch event
|
||||
collision_start(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ llDetectedGrab(0)
|
||||
//, llDetectedGroup(0)
|
||||
//, llDetectedKey(0)
|
||||
//, llDetectedLinkNumber(0)
|
||||
//, llDetectedName(0)
|
||||
//, llDetectedOwner(0)
|
||||
//, llDetectedPos(0)
|
||||
//, llDetectedRot(0)
|
||||
, llDetectedTouchBinormal(0)
|
||||
, llDetectedTouchFace(0)
|
||||
, llDetectedTouchNormal(0)
|
||||
, llDetectedTouchPos(0)
|
||||
, llDetectedTouchST(0)
|
||||
, llDetectedTouchUV(0)
|
||||
//, llDetectedType(0)
|
||||
//, llDetectedVel(0)
|
||||
]);
|
||||
}
|
||||
|
||||
// touch event but not touch()
|
||||
touch_start(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ llDetectedGrab(0) // only works in touch()
|
||||
, llDetectedGrab(-1) // only works in touch()
|
||||
, llDetectedGroup(16)
|
||||
, llDetectedKey(-1)
|
||||
, llDetectedLinkNumber(17)
|
||||
, llDetectedName(-1)
|
||||
, llDetectedOwner(32)
|
||||
, llDetectedPos(-1)
|
||||
, llDetectedRot(-1)
|
||||
, llDetectedTouchBinormal(-1)
|
||||
, llDetectedTouchFace(-1)
|
||||
, llDetectedTouchNormal(-1)
|
||||
, llDetectedTouchPos(-1)
|
||||
, llDetectedTouchST(-1)
|
||||
, llDetectedTouchUV(-1)
|
||||
, llDetectedType(-1)
|
||||
, llDetectedVel(-1)
|
||||
]);
|
||||
}
|
||||
|
||||
touch(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ llDetectedGrab(-1)
|
||||
]);
|
||||
}
|
||||
}
|
65
unit_tests/regression.suite/detect-computable.out
Normal file
65
unit_tests/regression.suite/detect-computable.out
Normal file
|
@ -0,0 +1,65 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ <0., 0., 0.>
|
||||
, 0
|
||||
, ((key)"00000000-0000-0000-0000-000000000000")
|
||||
, 0
|
||||
, "00000000-0000-0000-0000-000000000000"
|
||||
, ((key)"00000000-0000-0000-0000-000000000000")
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0., 1.>
|
||||
, <0., 0., 0.>
|
||||
, 0
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, 0
|
||||
, <0., 0., 0.>
|
||||
]);
|
||||
}
|
||||
|
||||
collision_start(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, -1
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, <-1., -1., 0.>
|
||||
, <-1., -1., 0.>
|
||||
]);
|
||||
}
|
||||
|
||||
touch_start(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, 0
|
||||
, ((key)"00000000-0000-0000-0000-000000000000")
|
||||
, 0
|
||||
, "00000000-0000-0000-0000-000000000000"
|
||||
, ((key)"00000000-0000-0000-0000-000000000000")
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0., 1.>
|
||||
, <0., 0., 0.>
|
||||
, 0
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, <0., 0., 0.>
|
||||
, 0
|
||||
, <0., 0., 0.>
|
||||
]);
|
||||
}
|
||||
|
||||
touch(integer n)
|
||||
{
|
||||
llSetPrimitiveParams((list)<0., 0., 0.>);
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/detect-computable.run
Normal file
1
unit_tests/regression.suite/detect-computable.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O -dcr,addstrings,-optfloats,-optsigns,-listadd -
|
25
unit_tests/regression.suite/detect-non-computable.lsl
Normal file
25
unit_tests/regression.suite/detect-non-computable.lsl
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Test functions in a detection event that can't be precomputed.
|
||||
default
|
||||
{
|
||||
touch(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ llDetectedGrab(0)
|
||||
, llDetectedGroup(0)
|
||||
, llDetectedKey(0)
|
||||
, llDetectedLinkNumber(0)
|
||||
, llDetectedName(0)
|
||||
, llDetectedOwner(0)
|
||||
, llDetectedPos(0)
|
||||
, llDetectedRot(0)
|
||||
, llDetectedTouchBinormal(0)
|
||||
, llDetectedTouchFace(0)
|
||||
, llDetectedTouchNormal(0)
|
||||
, llDetectedTouchPos(0)
|
||||
, llDetectedTouchST(0)
|
||||
, llDetectedTouchUV(0)
|
||||
, llDetectedType(0)
|
||||
, llDetectedVel(0)
|
||||
]);
|
||||
}
|
||||
}
|
24
unit_tests/regression.suite/detect-non-computable.out
Normal file
24
unit_tests/regression.suite/detect-non-computable.out
Normal file
|
@ -0,0 +1,24 @@
|
|||
default
|
||||
{
|
||||
touch(integer n)
|
||||
{
|
||||
llSetPrimitiveParams(
|
||||
[ llDetectedGrab(0)
|
||||
, llDetectedGroup(0)
|
||||
, llDetectedKey(0)
|
||||
, llDetectedLinkNumber(0)
|
||||
, llDetectedName(0)
|
||||
, llDetectedOwner(0)
|
||||
, llDetectedPos(0)
|
||||
, llDetectedRot(0)
|
||||
, llDetectedTouchBinormal(0)
|
||||
, llDetectedTouchFace(0)
|
||||
, llDetectedTouchNormal(0)
|
||||
, llDetectedTouchPos(0)
|
||||
, llDetectedTouchST(0)
|
||||
, llDetectedTouchUV(0)
|
||||
, llDetectedType(0)
|
||||
, llDetectedVel(0)
|
||||
]);
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/detect-non-computable.run
Normal file
1
unit_tests/regression.suite/detect-non-computable.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O -dcr,addstrings,-optfloats,-listadd -
|
20
unit_tests/regression.suite/dumplist2str.lsl
Normal file
20
unit_tests/regression.suite/dumplist2str.lsl
Normal file
|
@ -0,0 +1,20 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
string a = llGetObjectName();
|
||||
vector b = llGetPos();
|
||||
float c = llGetMass();
|
||||
llOwnerSay(llDumpList2String([a, b, c], "/"));
|
||||
llOwnerSay(llDumpList2String([], llGetObjectName()));
|
||||
llOwnerSay(llDumpList2String([1,2,3], a));
|
||||
llOwnerSay(llDumpList2String([llGetObjectName()], a));
|
||||
llOwnerSay(llDumpList2String([llGetObjectName(), llGetObjectName(), llGetObjectName()], a));
|
||||
llOwnerSay(llDumpList2String([a, b, c, llGetObjectName()], a));
|
||||
// TODO: This isn't properly optimized because the lists can't be merged:
|
||||
llOwnerSay(llDumpList2String([a] + [b, c, a + a + a], a));
|
||||
llOwnerSay(llDumpList2String([a, b, c, a + a + a], a));
|
||||
llOwnerSay(llDumpList2String([llSetRegionPos(<1,1,1>)], a));
|
||||
llOwnerSay(llDumpList2String([llSetRegionPos(<1,1,1>)], (string)llSetRegionPos(<1,1,1>)));
|
||||
}
|
||||
}
|
19
unit_tests/regression.suite/dumplist2str.out
Normal file
19
unit_tests/regression.suite/dumplist2str.out
Normal file
|
@ -0,0 +1,19 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
string a = llGetObjectName();
|
||||
vector b = llGetPos();
|
||||
float c = llGetMass();
|
||||
llOwnerSay(a + ("/" + ((string)((list)b) + ("/" + (string)c))));
|
||||
llOwnerSay("");
|
||||
llOwnerSay("1" + (a + ("2" + (a + "3"))));
|
||||
llOwnerSay(llGetObjectName());
|
||||
llOwnerSay(llGetObjectName() + (a + (llGetObjectName() + (a + llGetObjectName()))));
|
||||
llOwnerSay(a + (a + ((string)((list)b) + (a + ((string)c + (a + llGetObjectName()))))));
|
||||
llOwnerSay(llDumpList2String(a + ((list)b + c + (a + a + a)), a));
|
||||
llOwnerSay(a + (a + ((string)((list)b) + (a + ((string)c + (a + (a + a + a)))))));
|
||||
llOwnerSay((string)llSetRegionPos(<((float)1), ((float)1), ((float)1)>));
|
||||
llOwnerSay(llDumpList2String((list)llSetRegionPos(<((float)1), ((float)1), ((float)1)>), (string)llSetRegionPos(<((float)1), ((float)1), ((float)1)>)));
|
||||
}
|
||||
}
|
3
unit_tests/regression.suite/dup-id-1.err
Normal file
3
unit_tests/regression.suite/dup-id-1.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
@x;
|
||||
^
|
||||
(Line 3 char 4): ERROR: Name previously declared within scope
|
4
unit_tests/regression.suite/dup-id-1.lsl
Normal file
4
unit_tests/regression.suite/dup-id-1.lsl
Normal file
|
@ -0,0 +1,4 @@
|
|||
default{timer(){
|
||||
integer x;
|
||||
@x;
|
||||
}}
|
3
unit_tests/regression.suite/dup-id-2.err
Normal file
3
unit_tests/regression.suite/dup-id-2.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
x()
|
||||
^
|
||||
(Line 2 char 2): ERROR: Name previously declared within scope
|
6
unit_tests/regression.suite/dup-id-2.lsl
Normal file
6
unit_tests/regression.suite/dup-id-2.lsl
Normal file
|
@ -0,0 +1,6 @@
|
|||
integer x;
|
||||
x()
|
||||
{
|
||||
}
|
||||
|
||||
default{timer(){}}
|
3
unit_tests/regression.suite/dup-id-3.err
Normal file
3
unit_tests/regression.suite/dup-id-3.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
llDie()
|
||||
^
|
||||
(Line 1 char 6): ERROR: Name previously declared within scope
|
5
unit_tests/regression.suite/dup-id-3.lsl
Normal file
5
unit_tests/regression.suite/dup-id-3.lsl
Normal file
|
@ -0,0 +1,5 @@
|
|||
llDie()
|
||||
{
|
||||
}
|
||||
|
||||
default{timer(){}}
|
3
unit_tests/regression.suite/dup-id-4.err
Normal file
3
unit_tests/regression.suite/dup-id-4.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
integer llDie;
|
||||
^
|
||||
(Line 1 char 14): ERROR: Name previously declared within scope
|
3
unit_tests/regression.suite/dup-id-4.lsl
Normal file
3
unit_tests/regression.suite/dup-id-4.lsl
Normal file
|
@ -0,0 +1,3 @@
|
|||
integer llDie;
|
||||
|
||||
default{timer(){}}
|
3
unit_tests/regression.suite/dup-id-5.err
Normal file
3
unit_tests/regression.suite/dup-id-5.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
state x
|
||||
^
|
||||
(Line 3 char 7): ERROR: Name previously declared within scope
|
4
unit_tests/regression.suite/dup-id-5.lsl
Normal file
4
unit_tests/regression.suite/dup-id-5.lsl
Normal file
|
@ -0,0 +1,4 @@
|
|||
integer x;
|
||||
default{timer(){}}
|
||||
state x
|
||||
{timer(){}}
|
3
unit_tests/regression.suite/dup-id-6.err
Normal file
3
unit_tests/regression.suite/dup-id-6.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
state x
|
||||
^
|
||||
(Line 3 char 7): ERROR: Name previously declared within scope
|
4
unit_tests/regression.suite/dup-id-6.lsl
Normal file
4
unit_tests/regression.suite/dup-id-6.lsl
Normal file
|
@ -0,0 +1,4 @@
|
|||
x(){}
|
||||
default{timer(){}}
|
||||
state x
|
||||
{timer(){}}
|
3
unit_tests/regression.suite/empty.err
Normal file
3
unit_tests/regression.suite/empty.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
^
|
||||
(Line 1 char 1): ERROR: Unexpected EOF
|
0
unit_tests/regression.suite/empty.lsl
Normal file
0
unit_tests/regression.suite/empty.lsl
Normal file
9
unit_tests/regression.suite/explicitcast.lsl
Normal file
9
unit_tests/regression.suite/explicitcast.lsl
Normal file
|
@ -0,0 +1,9 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
key k = llList2String(llGetAgentList(AGENT_LIST_REGION, []), 0);
|
||||
float f = llGetAgentInfo(llGetOwner());
|
||||
llOwnerSay((string)[k, f]);
|
||||
}
|
||||
}
|
9
unit_tests/regression.suite/explicitcast.out
Normal file
9
unit_tests/regression.suite/explicitcast.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
key k = (key)llList2String(llGetAgentList(4, []), 0);
|
||||
float f = (float)llGetAgentInfo(llGetOwner());
|
||||
llOwnerSay((string)[k, f]);
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/explicitcast.run
Normal file
1
unit_tests/regression.suite/explicitcast.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O explicitcast,-optimize -
|
3
unit_tests/regression.suite/expressions-1.err
Normal file
3
unit_tests/regression.suite/expressions-1.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
-[1,2,3,4,5];
|
||||
^
|
||||
(Line 3 char 13): ERROR: Type mismatch
|
5
unit_tests/regression.suite/expressions-1.lsl
Normal file
5
unit_tests/regression.suite/expressions-1.lsl
Normal file
|
@ -0,0 +1,5 @@
|
|||
default{timer(){
|
||||
|
||||
-[1,2,3,4,5];
|
||||
|
||||
}}
|
1
unit_tests/regression.suite/expressions-1.run
Normal file
1
unit_tests/regression.suite/expressions-1.run
Normal file
|
@ -0,0 +1 @@
|
|||
./main.py - -O clear
|
12
unit_tests/regression.suite/flow.lsl
Normal file
12
unit_tests/regression.suite/flow.lsl
Normal file
|
@ -0,0 +1,12 @@
|
|||
default{timer(){
|
||||
|
||||
while (1)
|
||||
{
|
||||
jump bis;
|
||||
}
|
||||
|
||||
@bis;
|
||||
|
||||
llDie();
|
||||
|
||||
}}
|
12
unit_tests/regression.suite/flow.out
Normal file
12
unit_tests/regression.suite/flow.out
Normal file
|
@ -0,0 +1,12 @@
|
|||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
jump bis;
|
||||
}
|
||||
@bis;
|
||||
llDie();
|
||||
}
|
||||
}
|
10
unit_tests/regression.suite/func-in-code.lsl
Normal file
10
unit_tests/regression.suite/func-in-code.lsl
Normal file
|
@ -0,0 +1,10 @@
|
|||
default{touch(integer llList2Float){
|
||||
|
||||
integer llList2String = llGetNumberOfPrims();
|
||||
|
||||
rotation q = <llList2Float, llList2String, llList2Float, llList2String>;
|
||||
|
||||
list L = llGetPhysicsMaterial();
|
||||
llParticleSystem([llList2Float(L, 0), llList2String(L, 1), q]);
|
||||
|
||||
}}
|
10
unit_tests/regression.suite/func-in-code.out
Normal file
10
unit_tests/regression.suite/func-in-code.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
default
|
||||
{
|
||||
touch(integer llList2Float)
|
||||
{
|
||||
integer llList2String = llGetNumberOfPrims();
|
||||
rotation q = <llList2Float, llList2String, llList2Float, llList2String>;
|
||||
list L = llGetPhysicsMaterial();
|
||||
llParticleSystem((list)llList2Float(L, 0) + llList2String(L, 1) + q);
|
||||
}
|
||||
}
|
3
unit_tests/regression.suite/func-in-globals-1.err
Normal file
3
unit_tests/regression.suite/func-in-globals-1.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
integer y = x;
|
||||
^
|
||||
(Line 3 char 13): ERROR: Name not defined within scope
|
5
unit_tests/regression.suite/func-in-globals-1.lsl
Normal file
5
unit_tests/regression.suite/func-in-globals-1.lsl
Normal file
|
@ -0,0 +1,5 @@
|
|||
integer x(){return 0;}
|
||||
|
||||
integer y = x;
|
||||
|
||||
default{timer(){}}
|
4
unit_tests/regression.suite/func-in-globals-2.lsl
Normal file
4
unit_tests/regression.suite/func-in-globals-2.lsl
Normal file
|
@ -0,0 +1,4 @@
|
|||
integer a = llList2Integer;
|
||||
rotation q = <llList2Float, llList2Float, llList2Float, llList2Float>;
|
||||
|
||||
default{timer(){}}
|
9
unit_tests/regression.suite/func-in-globals-2.out
Normal file
9
unit_tests/regression.suite/func-in-globals-2.out
Normal file
|
@ -0,0 +1,9 @@
|
|||
integer a = llList2Integer;
|
||||
rotation q = <llList2Float, llList2Float, llList2Float, llList2Float>;
|
||||
|
||||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/func-in-globals-2.run
Normal file
1
unit_tests/regression.suite/func-in-globals-2.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O clear -
|
3
unit_tests/regression.suite/func-in-globals-3.err
Normal file
3
unit_tests/regression.suite/func-in-globals-3.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
integer a = llList2String;
|
||||
^
|
||||
(Line 1 char 26): ERROR: Type mismatch
|
3
unit_tests/regression.suite/func-in-globals-3.lsl
Normal file
3
unit_tests/regression.suite/func-in-globals-3.lsl
Normal file
|
@ -0,0 +1,3 @@
|
|||
integer a = llList2String;
|
||||
|
||||
default{timer(){}}
|
3
unit_tests/regression.suite/func-in-globals-4.err
Normal file
3
unit_tests/regression.suite/func-in-globals-4.err
Normal file
|
@ -0,0 +1,3 @@
|
|||
integer a = (integer)llList2Integer;
|
||||
^
|
||||
(Line 4 char 22): ERROR: Name not defined within scope
|
6
unit_tests/regression.suite/func-in-globals-4.lsl
Normal file
6
unit_tests/regression.suite/func-in-globals-4.lsl
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
default{timer(){
|
||||
|
||||
integer a = (integer)llList2Integer;
|
||||
|
||||
}}
|
7
unit_tests/regression.suite/func-params-opt.lsl
Normal file
7
unit_tests/regression.suite/func-params-opt.lsl
Normal file
|
@ -0,0 +1,7 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSensor("", "", AGENT, 10., PI);
|
||||
}
|
||||
}
|
7
unit_tests/regression.suite/func-params-opt.out
Normal file
7
unit_tests/regression.suite/func-params-opt.out
Normal file
|
@ -0,0 +1,7 @@
|
|||
default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
llSensor("", "", 1, ((float)10), ((float)4));
|
||||
}
|
||||
}
|
7
unit_tests/regression.suite/global-key-in-list-dcr.lsl
Normal file
7
unit_tests/regression.suite/global-key-in-list-dcr.lsl
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Check constant folding of global lists
|
||||
// Exposed ConstFold+DCR+ExtendedGlobalExpr bug, related to Issue #3.
|
||||
key k = TEXTURE_BLANK;
|
||||
list L = [k,""];
|
||||
default{timer(){
|
||||
llBreakLink(llListFindList(L, (list)k));
|
||||
}}
|
10
unit_tests/regression.suite/global-key-in-list-dcr.out
Normal file
10
unit_tests/regression.suite/global-key-in-list-dcr.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
key k = "5748decc-f629-461c-9a36-a35a221fe21f";
|
||||
list L = [k, ""];
|
||||
|
||||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
llBreakLink(llListFindList(L, (list)k));
|
||||
}
|
||||
}
|
1
unit_tests/regression.suite/global-key-in-list-dcr.run
Normal file
1
unit_tests/regression.suite/global-key-in-list-dcr.run
Normal file
|
@ -0,0 +1 @@
|
|||
main.py -O clear,optimize,constfold,dcr,extendedglobalexpr -
|
7
unit_tests/regression.suite/global-key-in-list-dcr2.lsl
Normal file
7
unit_tests/regression.suite/global-key-in-list-dcr2.lsl
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Check constant folding of global lists
|
||||
// Exposed ConstFold+DCR+ExtendedGlobalExpr bug, Issue #3.
|
||||
key k = TEXTURE_BLANK;
|
||||
list L = [k,""];
|
||||
default{timer(){
|
||||
L += "";
|
||||
}}
|
10
unit_tests/regression.suite/global-key-in-list-dcr2.out
Normal file
10
unit_tests/regression.suite/global-key-in-list-dcr2.out
Normal file
|
@ -0,0 +1,10 @@
|
|||
key k = "5748decc-f629-461c-9a36-a35a221fe21f";
|
||||
list L = [k, ""];
|
||||
|
||||
default
|
||||
{
|
||||
timer()
|
||||
{
|
||||
L = L + "";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
key k;
|
||||
list L = [k];
|
||||
default{timer(){
|
||||
L += "";
|
||||
llSetPrimitiveParams(L);
|
||||
}}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue