def test_add_signatures(self): old = '[@ x]\n[@ y]' new = ' [@ abc]\n[@ def ]\r\n [@ ghi ] \r\n[@ jkl] ' new = utils.get_signatures(new) sgns = utils.add_signatures(old, new) assert sgns == '[@ x]\n[@ y]\n[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]' sgns = utils.add_signatures('', new) assert sgns == '[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]'
def test_add_signatures(self): old = "[@ x]\n[@ y]" new = " [@ abc]\n[@ def ]\r\n [@ ghi ] \r\n[@ jkl] " new = utils.get_signatures(new) sgns = utils.add_signatures(old, new) assert sgns == "[@ x]\n[@ y]\n[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]" sgns = utils.add_signatures("", new) assert sgns == "[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]"
def set_autofix(self, bugs, dups, signatures, pcs): for bugid, missed_sgns in signatures.items(): sgns = dups[bugid]['signature'] sgns = utils.add_signatures(sgns, missed_sgns) self.autofix_data[bugid] = {'cf_crash_signature': sgns} for bugid, pc in pcs.items(): if bugid in self.autofix_data: self.autofix_data[bugid].update(pc) else: self.autofix_data[bugid] = pc
def set_autofix(self, bugs, dups, signatures, pcs): for bugid, missed_sgns in signatures.items(): sgns = dups[bugid]["signature"] sgns = utils.add_signatures(sgns, missed_sgns) self.autofix_data[bugid] = {"cf_crash_signature": sgns} for bugid, pc in pcs.items(): if bugid in self.autofix_data: self.autofix_data[bugid].update(pc) else: self.autofix_data[bugid] = pc