@@ -32,25 +32,33 @@ public void runTestActivityCommunication1() throws IOException, XmlPullParserExc
3232 @ Test (timeout =300000 )
3333
3434 public void runTestActivityCommunication2 () throws IOException , XmlPullParserException {
35+ int expected = 1 ;
36+ if (mode != TestResultMode .DROIDBENCH )
37+ expected = 0 ;
3538 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ActivityCommunication2.apk" );
3639 Assert .assertNotNull (res );
37- Assert .assertEquals (1 , res .size ());
40+ Assert .assertEquals (expected , res .size ());
3841 }
3942
4043 @ Test (timeout =300000 )
41-
4244 public void runTestActivityCommunication3 () throws IOException , XmlPullParserException {
45+ int expected = 1 ;
46+ if (mode != TestResultMode .DROIDBENCH )
47+ expected = 0 ;
4348 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ActivityCommunication3.apk" );
4449 Assert .assertNotNull (res );
45- Assert .assertEquals (1 , res .size ());
50+ Assert .assertEquals (expected , res .size ());
4651 }
4752
4853 @ Test (timeout =300000 )
4954
5055 public void runTestActivityCommunication4 () throws IOException , XmlPullParserException {
56+ int expected = 1 ;
57+ if (mode != TestResultMode .DROIDBENCH )
58+ expected = 0 ;
5159 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ActivityCommunication4.apk" );
5260 Assert .assertNotNull (res );
53- Assert .assertEquals (1 , res .size ());
61+ Assert .assertEquals (expected , res .size ());
5462 }
5563
5664 @ Test (timeout =300000 )
@@ -64,25 +72,32 @@ public void runTestActivityCommunication5() throws IOException, XmlPullParserExc
6472 @ Test (timeout =300000 )
6573
6674 public void runTestActivityCommunication6 () throws IOException , XmlPullParserException {
75+ int expected = 1 ;
76+ if (mode != TestResultMode .DROIDBENCH )
77+ expected = 0 ;
6778 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ActivityCommunication6.apk" );
6879 Assert .assertNotNull (res );
69- Assert .assertEquals (1 , res .size ());
80+ Assert .assertEquals (expected , res .size ());
7081 }
7182
7283 @ Test (timeout =300000 )
73-
7484 public void runTestActivityCommunication7 () throws IOException , XmlPullParserException {
85+ int expected = 1 ;
86+ if (mode != TestResultMode .DROIDBENCH )
87+ expected = 0 ;
7588 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ActivityCommunication7.apk" );
7689 Assert .assertNotNull (res );
77- Assert .assertEquals (1 , res .size ());
90+ Assert .assertEquals (expected , res .size ());
7891 }
7992
8093 @ Test (timeout =300000 )
81-
8294 public void runTestActivityCommunication8 () throws IOException , XmlPullParserException {
95+ int expected = 1 ;
96+ if (mode != TestResultMode .DROIDBENCH )
97+ expected = 0 ;
8398 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ActivityCommunication8.apk" );
8499 Assert .assertNotNull (res );
85- Assert .assertEquals (1 , res .size ());
100+ Assert .assertEquals (expected , res .size ());
86101 }
87102
88103 @ Test (timeout =300000 )
@@ -119,29 +134,37 @@ public void runTestIntentSink1() throws IOException, XmlPullParserException {
119134 @ Test (timeout =300000 )
120135 //("startActivity() is no longer a sink")
121136 public void runTestIntentSink2 () throws IOException , XmlPullParserException {
137+ int expected = 1 ;
138+ if (mode != TestResultMode .DROIDBENCH )
139+ expected = 0 ;
122140 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/IntentSink2.apk" );
123141 Assert .assertNotNull (res );
124- Assert .assertEquals (1 , res .size ());
142+ Assert .assertEquals (expected , res .size ());
125143 }
126144
127145 @ Test (timeout =300000 )
128146
129147 public void runTestIntentSource1 () throws IOException , XmlPullParserException {
148+ int expected = 1 ;
149+ if (mode != TestResultMode .DROIDBENCH )
150+ expected = 0 ;
130151 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/IntentSource1.apk" );
131152 Assert .assertNotNull (res );
132- Assert .assertEquals (1 , res .size ());
153+ Assert .assertEquals (expected , res .size ());
133154 }
134155
135156 @ Test (timeout =300000 )
136157
137158 public void runTestServiceCommunication1 () throws IOException , XmlPullParserException {
159+ int expected = 1 ;
160+ if (mode != TestResultMode .DROIDBENCH )
161+ expected = 0 ;
138162 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/ServiceCommunication1.apk" );
139163 Assert .assertNotNull (res );
140- Assert .assertEquals (1 , res .size ());
164+ Assert .assertEquals (expected , res .size ());
141165 }
142166
143167 @ Test (timeout =300000 )
144-
145168 public void runTestSharedPreferences1 () throws IOException , XmlPullParserException {
146169 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/SharedPreferences1.apk" );
147170 Assert .assertNotNull (res );
@@ -159,9 +182,12 @@ public void runTestSingletons1() throws IOException, XmlPullParserException {
159182 @ Test (timeout =300000 )
160183
161184 public void runTestUnresolvableIntent1 () throws IOException , XmlPullParserException {
185+ int expected = 1 ;
186+ if (mode != TestResultMode .DROIDBENCH )
187+ expected = 0 ;
162188 InfoflowResults res = analyzeAPKFile ("InterComponentCommunication/UnresolvableIntent1.apk" );
163189 Assert .assertNotNull (res );
164- Assert .assertEquals (2 , res .size ());
190+ Assert .assertEquals (expected , res .size ());
165191 }
166192
167193}
0 commit comments