@@ -12,15 +12,184 @@ def _get_folder_name():
12
12
return os .path .basename (_get_this_file_dir ())
13
13
14
14
15
- @pytest .mark .xfail
16
- def test_recent_alloc_clear_from_callees (tmpdir ):
15
+ def test_should_be_most_recent (tmpdir ):
17
16
"""
18
- Checks whether 'is_most_recent_allocation' flag is cleared when
17
+ [1] Checks whether 'is_most_recent_allocation' flag is cleared when
19
18
receiving DOs from callees.
20
19
"""
21
20
with utils .working_dir (_get_this_file_dir ()):
22
21
os .system ("javac Test.java" )
23
- lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('main' )
22
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent' )
23
+ lvsa_expectation = lvsa_driver .run ()
24
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
25
+ value_set_expectation .check_contains_dynamic_object (1 , True )
26
+
27
+
28
+ def test_should_be_most_recent_one_call (tmpdir ):
29
+ """
30
+ [2] Checks whether 'is_most_recent_allocation' flag is cleared when
31
+ receiving DOs from callees.
32
+ """
33
+ with utils .working_dir (_get_this_file_dir ()):
34
+ os .system ("javac Test.java" )
35
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_one_call' )
36
+ lvsa_expectation = lvsa_driver .run ()
37
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
38
+ value_set_expectation .check_contains_dynamic_object (1 , True )
39
+
40
+
41
+ def test_should_be_most_recent_two_calls (tmpdir ):
42
+ """
43
+ [3] Checks whether 'is_most_recent_allocation' flag is cleared when
44
+ receiving DOs from callees.
45
+ """
46
+ with utils .working_dir (_get_this_file_dir ()):
47
+ os .system ("javac Test.java" )
48
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_two_calls' )
49
+ lvsa_expectation = lvsa_driver .run ()
50
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
51
+ value_set_expectation .check_contains_dynamic_object (1 , True )
52
+
53
+
54
+ def test_should_not_be_most_recent_two_calls (tmpdir ):
55
+ """
56
+ [4] Checks whether 'is_most_recent_allocation' flag is cleared when
57
+ receiving DOs from callees.
58
+ """
59
+ with utils .working_dir (_get_this_file_dir ()):
60
+ os .system ("javac Test.java" )
61
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_not_be_most_recent_two_calls' )
24
62
lvsa_expectation = lvsa_driver .run ()
25
63
value_set_expectation = lvsa_expectation .get_value_set_for_output ()
26
64
value_set_expectation .check_contains_dynamic_object (1 , False )
65
+
66
+
67
+ def test_should_be_most_recent_local (tmpdir ):
68
+ """
69
+ [5] Checks whether 'is_most_recent_allocation' flag is cleared when
70
+ receiving DOs from callees.
71
+ """
72
+ with utils .working_dir (_get_this_file_dir ()):
73
+ os .system ("javac Test.java" )
74
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_local' )
75
+ lvsa_expectation = lvsa_driver .run ()
76
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
77
+ value_set_expectation .check_contains_dynamic_object (1 , True )
78
+
79
+
80
+ def test_should_be_most_recent_other_call (tmpdir ):
81
+ """
82
+ [6] Checks whether 'is_most_recent_allocation' flag is cleared when
83
+ receiving DOs from callees.
84
+ """
85
+ with utils .working_dir (_get_this_file_dir ()):
86
+ os .system ("javac Test.java" )
87
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_other_call' )
88
+ lvsa_expectation = lvsa_driver .run ()
89
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
90
+ value_set_expectation .check_contains_dynamic_object (1 , True )
91
+
92
+
93
+ def test_should_not_be_most_recent_A_1 (tmpdir ):
94
+ """
95
+ [7] Checks whether 'is_most_recent_allocation' flag is cleared when
96
+ receiving DOs from callees.
97
+ """
98
+ with utils .working_dir (_get_this_file_dir ()):
99
+ os .system ("javac Test.java" )
100
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_not_be_most_recent_A_1' )
101
+ lvsa_expectation = lvsa_driver .run ()
102
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
103
+ value_set_expectation .check_contains_dynamic_object (1 , False )
104
+
105
+
106
+ def test_should_be_most_recent_A_2 (tmpdir ):
107
+ """
108
+ [8] Checks whether 'is_most_recent_allocation' flag is cleared when
109
+ receiving DOs from callees.
110
+ """
111
+ with utils .working_dir (_get_this_file_dir ()):
112
+ os .system ("javac Test.java" )
113
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_A_2' )
114
+ lvsa_expectation = lvsa_driver .run ()
115
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
116
+ value_set_expectation .check_contains_dynamic_object (1 , True )
117
+
118
+
119
+ def test_should_not_be_most_recent_A_3 (tmpdir ):
120
+ """
121
+ [9] Checks whether 'is_most_recent_allocation' flag is cleared when
122
+ receiving DOs from callees.
123
+ """
124
+ with utils .working_dir (_get_this_file_dir ()):
125
+ os .system ("javac Test.java" )
126
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_not_be_most_recent_A_3' )
127
+ lvsa_expectation = lvsa_driver .run ()
128
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
129
+ value_set_expectation .check_contains_dynamic_object (1 , False )
130
+
131
+
132
+ def test_should_be_most_recent_A_3 (tmpdir ):
133
+ """
134
+ [10] Checks whether 'is_most_recent_allocation' flag is cleared when
135
+ receiving DOs from callees.
136
+ """
137
+ with utils .working_dir (_get_this_file_dir ()):
138
+ os .system ("javac Test.java" )
139
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_A_3' )
140
+ lvsa_expectation = lvsa_driver .run ()
141
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
142
+ value_set_expectation .check_contains_dynamic_object (1 , True )
143
+
144
+
145
+ def test_should_be_most_recent_A_4 (tmpdir ):
146
+ """
147
+ [11] Checks whether 'is_most_recent_allocation' flag is cleared when
148
+ receiving DOs from callees.
149
+ """
150
+ with utils .working_dir (_get_this_file_dir ()):
151
+ os .system ("javac Test.java" )
152
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_A_4' )
153
+ lvsa_expectation = lvsa_driver .run ()
154
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
155
+ value_set_expectation .check_contains_dynamic_object (1 , True )
156
+
157
+
158
+ def test_should_not_be_most_recent_caller_1 (tmpdir ):
159
+ """
160
+ [12] Checks whether 'is_most_recent_allocation' flag is cleared when
161
+ receiving DOs from callees.
162
+ """
163
+ with utils .working_dir (_get_this_file_dir ()):
164
+ os .system ("javac Test.java" )
165
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_not_be_most_recent_caller_1' )
166
+ lvsa_expectation = lvsa_driver .run ()
167
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
168
+ value_set_expectation .check_contains_dynamic_object (1 , False )
169
+
170
+
171
+ @pytest .mark .xfail (strict = True )
172
+ def test_should_not_be_most_recent_caller_2 (tmpdir ):
173
+ """
174
+ [13] Checks whether 'is_most_recent_allocation' flag is cleared when
175
+ receiving DOs from callees.
176
+ """
177
+ with utils .working_dir (_get_this_file_dir ()):
178
+ os .system ("javac Test.java" )
179
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_not_be_most_recent_caller_2' )
180
+ lvsa_expectation = lvsa_driver .run ()
181
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
182
+ value_set_expectation .check_contains_dynamic_object (1 , False )
183
+
184
+
185
+ def test_should_be_most_recent_lhs_issue (tmpdir ):
186
+ """
187
+ [14] Checks whether 'is_most_recent_allocation' flag is cleared when
188
+ receiving DOs from callees.
189
+ """
190
+ with utils .working_dir (_get_this_file_dir ()):
191
+ os .system ("javac Test.java" )
192
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_lhs_issue' )
193
+ lvsa_expectation = lvsa_driver .run ()
194
+ value_set_expectation = lvsa_expectation .get_value_set_for_output ()
195
+ value_set_expectation .check_contains_dynamic_object (1 , True )
0 commit comments