aboutsummaryrefslogtreecommitdiffstats
path: root/tests/rpc_smoke.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rpc_smoke.py')
-rw-r--r--tests/rpc_smoke.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rpc_smoke.py b/tests/rpc_smoke.py
index 5d24978..fe2b79b 100644
--- a/tests/rpc_smoke.py
+++ b/tests/rpc_smoke.py
@@ -186,6 +186,20 @@ async def run(db):
callee is not None and all("frm" in x for x in callee[1]),
"no referenced function found" if callee is None else "")
+ # xrefs_from a function is whole-body (decomp refs), not just the entry:
+ # find a function that actually calls something.
+ caller = next((f["name"] for f in funcs if f["name"] == "main"), None)
+ xf = []
+ for name in ([caller] if caller else []) + [f["name"] for f in funcs]:
+ xf = (await c.call("xrefs_from", target=name)).get("result", [])
+ if any(x.get("is_func") for x in xf):
+ caller = name
+ break
+ check("xrefs_from a function lists whole-body callees",
+ isinstance(xf, list) and len(xf) > 1
+ and any(x.get("is_func") for x in xf) and all("to" in x for x in xf),
+ f"caller={caller} n={len(xf)}")
+
# --- modal select: open xrefs on the callee, pick the first site --- #
if callee is not None:
f, xr = callee