Skip to content

Commit c873275

Browse files
committed
Add test unit for QuarkResult.findMethodInCaller()
1 parent b307828 commit c873275

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/script/test_script.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,22 @@ def testMethodGetXrefFrom(QUARK_ANALYSIS_RESULT):
230230
def testgetAllStrings(QUARK_ANALYSIS_RESULT):
231231
assert len(QUARK_ANALYSIS_RESULT.getAllStrings()) == 1005
232232

233+
@staticmethod
234+
def testfindMethodInCaller(QUARK_ANALYSIS_RESULT):
235+
callerMethod = [
236+
"Lcom/google/progress/WifiCheckTask;",
237+
"checkWifiCanOrNotConnectServer",
238+
"([Ljava/lang/String;)Z",
239+
]
240+
targetMethod = [
241+
"Landroid/util/Log;",
242+
"e",
243+
"(Ljava/lang/String; Ljava/lang/String;)I",
244+
]
245+
246+
assert QUARK_ANALYSIS_RESULT.findMethodInCaller(
247+
callerMethod, targetMethod)
248+
233249

234250
def testRunQuarkAnalysis(SAMPLE_PATH):
235251
ruleset = Ruleset(RULE_FOLDER_PATH)

0 commit comments

Comments
 (0)