STRU and exception tasks accepted; G6 cascade fix, exception class mutants, RTTI unit notes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -169,6 +169,8 @@ def decl_mutants(src, otype, seed, n=MAX_MUTANTS):
|
||||
for m in re.finditer(r"^(\s*)key(\s+)(?!client\b)(\w+\s*:)", src, re.I | re.M):
|
||||
add("key", m, f"{m.group(1)}{m.group(3)}")
|
||||
if otype == "INTF":
|
||||
for m in re.finditer(r"(\bmsgno\s*=\s*')(\d+)(')", src, re.I): # message number of an exception text id
|
||||
add("msgno", m, f"{m.group(1)}{str(int(m.group(2)) + 1).zfill(len(m.group(2)))}{m.group(3)}")
|
||||
for m in re.finditer(r"(\bVALUE\s+)(\d+)(?=\s*\.)", src, re.I):
|
||||
add("const", m, f"{m.group(1)}{int(m.group(2)) + 1}")
|
||||
for m in re.finditer(r"(\bVALUE\s+)'([^'\n]{1,20})'", src, re.I):
|
||||
@@ -236,7 +238,10 @@ def check_task(pool_root, task_id, run_base, n=MAX_MUTANTS, keep=False):
|
||||
src = open(os.path.join(task_dir, o["file"])).read()
|
||||
if o["type"] in ("TABL", "STRU", "INTF"):
|
||||
return decl_mutants(src, o["type"], f"{task_id}:{o['name']}", n)
|
||||
return mutants(src, o["type"], f"{task_id}:{o['name']}", n)
|
||||
ms = mutants(src, o["type"], f"{task_id}:{o['name']}", n)
|
||||
if o["type"] == "CLAS" and len(ms) < n: # exception classes: constants, message numbers, texts
|
||||
ms += decl_mutants(src, "INTF", f"{task_id}:{o['name']}", n - len(ms))
|
||||
return ms
|
||||
cand = [[(o, d, m) for d, m in _muts(o)] for o in targets]
|
||||
plan = []
|
||||
while len(plan) < n and any(cand):
|
||||
|
||||
Reference in New Issue
Block a user