Skip to content

Commit 16711c5

Browse files
authored
Merge pull request diffblue#406 from diffblue/making_checks_of_end_to_end_regressions_tests_more_precise
Making checks in end-to-end regression tests more precise.
2 parents 3630d94 + c2e7ad8 commit 16711c5

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

regression/end_to_end/general001/test_general001.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ def test_general001():
1313
"taint_traces_01_rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"Main.bar") as traces:
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 1
1717
assert traces.trace_exists("java::Main.bug:(I)V", 84)

regression/end_to_end/general004/test_general004.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_general004():
1313
"taint_traces_04_rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"Main.start") as traces:
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 3
1717
assert traces.trace_exists("java::Main.baz0:()V", 19)
1818
assert traces.trace_exists("java::Main.baz1:()V", 26)
1919
assert traces.trace_exists("java::Main.baz2:(LOther;)V", 32)

regression/end_to_end/general005/test_general005.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ def test_general005():
1313
"taint_traces_05_rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"AssignmentAction.doUpload_all") as traces:
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 1
1717
assert traces.trace_exists("java::DummyAssignmentSubmissionEdit.setSubmittedText:(Ljava/lang/String;)V", 3)

regression/end_to_end/general006/test_general006.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_general006():
1515
"taint_traces_06_rules.json",
1616
os.path.realpath(os.path.dirname(__file__)),
1717
"taint_test.test.doGet") as traces:
18-
assert traces.count_traces() > 0
18+
assert traces.count_traces() == 2
1919
assert traces.trace_exists(
2020
"java::taint_test.test.doGet:(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V",
2121
165)

regression/end_to_end/general007/test_general007.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ def test_general007():
1313
"taint_traces_07_rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"training07.test.doGet") as traces:
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 1
1717
assert traces.trace_exists(
1818
"java::training07.test.doGet:(Ltraining07/HttpServletRequest;Ltraining07/HttpServletResponse;)V", 109)

regression/end_to_end/tainted-array-type/test_tainted_array_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ def test_user_class():
1313
"rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"test.main")
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 1
1717
assert traces.trace_exists("java::test.main:(I)V", 16)

regression/end_to_end/tainted-integers/test_tainted_integers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_tainted_integers_taint_flows_inwards():
1313
"rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"flow_in.main")
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 1
1717
assert traces.trace_exists("java::flow_in.checker:(I)V", 5)
1818

1919

@@ -25,7 +25,7 @@ def test_tainted_integers_taint_flows_outwards():
2525
"rules.json",
2626
os.path.realpath(os.path.dirname(__file__)),
2727
"flow_out.main")
28-
assert traces.count_traces() > 0
28+
assert traces.count_traces() == 1
2929
assert traces.trace_exists("java::flow_out.main:(I)V", 21)
3030

3131

@@ -37,7 +37,7 @@ def test_tainted_integers_single_function():
3737
"rules.json",
3838
os.path.realpath(os.path.dirname(__file__)),
3939
"single_function.main")
40-
assert traces.count_traces() > 0
40+
assert traces.count_traces() == 1
4141
assert traces.trace_exists("java::single_function.main:(I)V", 13)
4242

4343

@@ -49,7 +49,7 @@ def test_tainted_integers_taint_stored_in_array():
4949
"rules.json",
5050
os.path.realpath(os.path.dirname(__file__)),
5151
"stored_in_array.main")
52-
assert traces.count_traces() > 0
52+
assert traces.count_traces() == 1
5353
assert traces.trace_exists("java::stored_in_array.main:(I)V", 16)
5454

5555

@@ -61,7 +61,7 @@ def test_tainted_integers_taint_stored_in_fields():
6161
"rules.json",
6262
os.path.realpath(os.path.dirname(__file__)),
6363
"stored_in_fields.main")
64-
assert traces.count_traces() > 0
64+
assert traces.count_traces() == 1
6565
assert traces.trace_exists("java::stored_in_fields.main:(I)V", 18)
6666

6767

@@ -73,7 +73,7 @@ def test_tainted_integers_dependent_taint():
7373
"rules.json",
7474
os.path.realpath(os.path.dirname(__file__)),
7575
"dependent_taint.main")
76-
assert traces.count_traces() > 0
76+
assert traces.count_traces() == 1
7777
assert traces.trace_exists("java::dependent_taint.main:(I)V", 15)
7878
assert not traces.trace_exists("java::dependent_taint.main:(I)V", 18)
7979

@@ -86,5 +86,5 @@ def test_tainted_integers_dependent_taint_in_summary():
8686
"rules.json",
8787
os.path.realpath(os.path.dirname(__file__)),
8888
"dependent_taint_in_summary.main")
89-
assert traces.count_traces() > 0
89+
assert traces.count_traces() == 1
9090
assert traces.trace_exists("java::dependent_taint_in_summary.main:()V", 11)

regression/end_to_end/tainted-string-type-concat/test_tainted_string_type_concat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ def test_taint_crossing_substr_and_concatenation():
1313
"rules.json",
1414
os.path.realpath(os.path.dirname(__file__)),
1515
"concat.main")
16-
assert traces.count_traces() > 0
16+
assert traces.count_traces() == 1
1717
assert not traces.trace_exists("java::concat.main:(I)V", 18)
1818
assert traces.trace_exists("java::concat.main:(I)V", 20)

regression/end_to_end/tainted-string-type/test_tainted_string_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ def test_tainted_string():
1212
"rules.json",
1313
os.path.realpath(os.path.dirname(__file__)),
1414
"test.main")
15-
assert traces.count_traces() > 0
15+
assert traces.count_traces() == 1
1616
assert traces.trace_exists("java::test.main:(I)V", 16)

0 commit comments

Comments
 (0)