Skip to content

Commit

Permalink
Update more Instruction test instances
Browse files Browse the repository at this point in the history
  • Loading branch information
whyitfor committed Jan 9, 2025
1 parent 7f25c45 commit 67a3f36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
(Instruction,),
(
AttributesType[Instruction](
"ldrsh.w r3, [r7,#0x1C]",
"ldrsh.w",
"r3, [r7,#0x1C]",
InstructionSetMode.NONE,
Expand Down Expand Up @@ -55,7 +54,6 @@
(Instruction,),
(
AttributesType[Instruction](
"add r2, r3, 1",
"add",
"r2, r3, 1",
InstructionSetMode.THUMB,
Expand Down Expand Up @@ -85,7 +83,6 @@
(Instruction,),
(
AttributesType[Instruction](
"add r2, r3, 1",
"add",
"r2, r3, 1",
InstructionSetMode.NONE,
Expand Down
9 changes: 2 additions & 7 deletions ofrak_core/test_ofrak/unit/resource_view/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def mock_instruction():
0x4,
),
AttributesType[Instruction](
"add r1, r2, r3",
"add",
"r1, r2, r3",
InstructionSetMode.NONE,
Expand All @@ -67,7 +66,6 @@ def mock_instruction_view():
return Instruction(
0x100,
0x4,
"add r1, r2, r3",
"add",
"r1, r2, r3",
InstructionSetMode.NONE,
Expand Down Expand Up @@ -212,7 +210,6 @@ async def test_AttributesType():

# With a type parameter, the constructor of an actual attribute is used
_ = AttributesType[Instruction](
"add r1, r2, r3",
"add",
"r1, r2, r3",
InstructionSetMode.NONE,
Expand All @@ -232,7 +229,7 @@ async def instr_view(ofrak_context: OFRAKContext):
b"\x00" * 4,
(Instruction,),
)
instr_r.add_view(Instruction(0x100, 0x4, "", "", "", InstructionSetMode.NONE))
instr_r.add_view(Instruction(0x100, 0x4, "", "", InstructionSetMode.NONE))
instr_r.add_attributes(
ProgramAttributes(
InstructionSet.ARM,
Expand Down Expand Up @@ -268,9 +265,7 @@ async def test_modifier_updates_view(instr_view: Instruction):


async def test_save_updates_view(instr_view: Instruction):
instr_view.resource.add_view(
Instruction(0x100, 0x4, "sub r4, r5", "sub", "r4, r5", InstructionSetMode.NONE)
)
instr_view.resource.add_view(Instruction(0x100, 0x4, "sub", "r4, r5", InstructionSetMode.NONE))
await instr_view.resource.save()

assert instr_view.mnemonic == "sub"
Expand Down

0 comments on commit 67a3f36

Please sign in to comment.