Skip to content

Commit

Permalink
Fix endian issues in ArmRelocator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole André Vadla Ravnås committed Apr 16, 2014
1 parent 1ebf8a5 commit 9fc26b2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/core/arch-arm/armrelocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ TEST_LIST_END ()
RELOCATOR_TESTCASE (one_to_one)
{
const guint32 input[] = {
0xe1a0c00d, /* mov ip, sp */
0xe92d0030, /* push {r4, r5} */
GUINT32_TO_LE (0xe1a0c00d), /* mov ip, sp */
GUINT32_TO_LE (0xe92d0030), /* push {r4, r5} */
};
const GumArmInstruction * insn;

Expand Down Expand Up @@ -201,9 +201,15 @@ static void
branch_scenario_execute (BranchScenario * bs,
TestArmRelocatorFixture * fixture)
{
gsize i;
guint32 calculated_pc;
const GumArmInstruction * insn = NULL;

for (i = 0; i != bs->input_length; i++)
bs->input[i] = GUINT32_TO_LE (bs->input[i]);
for (i = 0; i != bs->expected_output_length; i++)
bs->expected_output[i] = GUINT32_TO_LE (bs->expected_output[i]);

SETUP_RELOCATOR_WITH (bs->input);

calculated_pc = fixture->rl.input_pc + 8 + bs->expected_pc_distance;
Expand Down

0 comments on commit 9fc26b2

Please sign in to comment.