def test_patch_asm_timeval(): forest = TraceForest(1) trace = Trace(forest, 'bridge', 0, 0) trace.start_mark(const.MARK_TRACE_ASM) trace.set_addr_bounds(0, 9) trace.add_instr(FlatOp(0, 'hello', ['world'], None, None)) trace.get_stage('asm').get_last_op().set_core_dump(0, 'abcdef') trace.add_instr(FlatOp(0, 'add', ['i1', 'i2'], 'i3', None)) trace.get_stage('asm').get_last_op().set_core_dump(6, 'a312') forest.patch_memory(4, '4321', 1) trace.get_core_dump(0) == "abcdefa312" trace.get_core_dump(1) == "abcd432112"