From c152f5b82ffea7e73d7c4d50774dbc7111fd7c21 Mon Sep 17 00:00:00 2001 From: Mrinal Ganesh Date: Mon, 13 Nov 2023 14:49:08 +0800 Subject: [PATCH 1/3] Add more tests --- .../M3_With_Nested_queries.txt | 68 +++++++++++++++++++ .../M3_With_Nested_source.txt | 15 ++++ 2 files changed, 83 insertions(+) create mode 100644 Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_queries.txt create mode 100644 Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_source.txt diff --git a/Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_queries.txt b/Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_queries.txt new file mode 100644 index 0000000..a235a17 --- /dev/null +++ b/Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_queries.txt @@ -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 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 + + + diff --git a/Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_source.txt b/Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_source.txt new file mode 100644 index 0000000..731abf8 --- /dev/null +++ b/Team16/Tests16/Milestone3/Complicated_Source_Valid_Queries/M3_With_Nested_source.txt @@ -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; +} \ No newline at end of file From 72e99a44bb03f5213c4e91095b9730defe793ad6 Mon Sep 17 00:00:00 2001 From: Mrinal Ganesh Date: Mon, 13 Nov 2023 15:01:58 +0800 Subject: [PATCH 2/3] Add some more tests --- .../M3_Overkill_Random_queries.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt b/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt index 7690892..0555213 100644 --- a/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt +++ b/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt @@ -37,4 +37,14 @@ none while w1; variable v1; Select such that Parent(_, w1) and Uses(w1, v1) with v1.varName="rose" 46 rose, 3 rose +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 \ No newline at end of file From ac6772e79577d61c224b70610232861feefe72da Mon Sep 17 00:00:00 2001 From: Mrinal Ganesh Date: Mon, 13 Nov 2023 15:31:42 +0800 Subject: [PATCH 3/3] Add ultralong query with empty set --- .../M3_Overkill_Random_queries.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt b/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt index 0555213..947f636 100644 --- a/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt +++ b/Team16/Tests16/Milestone3/Overkill_Source_Valid_Queries/M3_Overkill_Random_queries.txt @@ -47,4 +47,10 @@ none stmt s1, s2; variable v; Select s1 such that Affects(s1, s2) 14,34,35,37,38,39,44,49,50,6 -5000 \ No newline at end of file +5000 +11 - Timeout testing 2 +procedure p1, p2, p3; stmt s1, s2, s3; variable v; +Select 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 +