Skip to content

Commit

Permalink
Merge pull request #188 from nus-cs3203/add-more-tests
Browse files Browse the repository at this point in the history
Add more tests
  • Loading branch information
mrmrinal authored Nov 13, 2023
2 parents da70417 + ac6772e commit cf177ae
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
1 - Most Basic With clause
procedure p;
Select p with p.procName = "p1"
p1
5000
2 - Basic With Clause procedure
procedure p; variable v;
Select p such that Modifies(p, v) with "a" = v.varName
p1
5000
3 - Basic With Clause procedure 2
procedure p; variable v;
Select p such that Modifies(p, v) with v.varName = "a"
p1
5000
4 - Basic With Clause which is not there
procedure p; variable v;
Select p such that Modifies(p, v) with "b" = v.varName
none
5000
5 - Basic With Clause which is not there 2
procedure p; variable v;
Select p such that Modifies(p, v) with v.varName = "b"
none
5000
6 - Combine 2 With clauses
procedure p; variable v;
Select p such that Modifies(p, v) with v.varName = "a" with p.procName = "p1"
p1
5000
7 - Combine 2 With clauses with empty set
procedure p; variable v;
Select p such that Modifies(p, v) with v.varName = "a" with p.procName = "p2"
none
5000
8 - Combine 2 With clauses with empty set
procedure p; variable v;
Select p such that Modifies(p, v) with v.varName = "b" with p.procName = "p1"
none
5000
9 - Select read statement
read r;
Select r such that Modifies(r, "r") with r.stmt# = 9
9
5000
10 - Select read statement
read r;
Select r such that Modifies(r, "p") with r.stmt# = 9
none
5000
11 - Select read statement
read r;
Select r such that Modifies(r, "r") with 9 = r.stmt#
9
5000
12 - Select assign statement
assign a;
Select a such that Affects(1, a) with a.stmt# = 6
6
5000
13 - Test and clause
stmt s1, s2; variable v;
Select <s1, s2> such that Uses(s1, v) with s2.stmt# = s1.stmt#
1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7
5000



Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
procedure p1 {
a = b + c;
call p2;
while (! ((a > b)&&( (a == b) || ((a != b) && ((a < b) || ((a <= b) && (a>= (0+(0-(0*(0/(0%(((0))))))))))))))) {
a = 2 + b;
x = a + 2;
}
x = a + 3;
}

procedure p2 {
p = q + r;
r = 4 + 3;
read r;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,20 @@ none
while w1; variable v1;
Select <w1.stmt#, v1> such that Parent(_, w1) and Uses(w1, v1) with v1.varName="rose"
46 rose, 3 rose
5000
5000
9 - Timeout testing
stmt s1, s2, s3, s4; variable v1;
Select s1 such that Modifies(s1, "a") and Affects(s1, s2) and Uses(s2, v1) and Uses(s3, v1) with s3.stmt# = 100
none
5000
10 - Affects
stmt s1, s2; variable v;
Select s1 such that Affects(s1, s2)
14,34,35,37,38,39,44,49,50,6
5000
11 - Timeout testing 2
procedure p1, p2, p3; stmt s1, s2, s3; variable v;
Select <p1, p3, s1> such that Modifies(p1, "a") and Uses(p2, "bandung") and Uses(p2, "y") and Calls(p1, p2) and Parent(2, 3) and Affects(s1, s2) and Affects(s1, s3) and Calls (p2, p3) and Uses(p2, "ljfalsdfsdfdsfs") and Next*(7, 6) and Next*(8, 6) and Next*(9, 6) and Affects(s1, s1) and Affects(s3, s1) and Uses(p1, "vallelonga")
none
5000

0 comments on commit cf177ae

Please sign in to comment.