Skip to content

Commit

Permalink
[bigendian] Add even more debugging print out
Browse files Browse the repository at this point in the history
  • Loading branch information
thoni56 committed Sep 25, 2023
1 parent fc30e9a commit c9343fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/constraint.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,17 @@ static void capture_parameter(Constraint *constraint, const char *function, Cgre
void *start_address = &actual.value + offset;
fprintf(stderr, "DEBUG: Attempting to adjust adress to captured value with %ld bytes\n", offset);
fprintf(stderr, "DEBUG: sizeof(intptr_t) = %ld\n", sizeof(intptr_t));
fprintf(stderr, "DEBUG: constraint->expected_value.pointer_value = %p\n", constraint->expected_value.value.pointer_value);
fprintf(stderr, "DEBUG: &actual.value = %p\n", &actual.value);
fprintf(stderr, "DEBUG: &actual.value.integer_value = %p\n", &actual.value.integer_value);
fprintf(stderr, "DEBUG: &actual.value.pointer_value = %p\n", &actual.value.pointer_value);
fprintf(stderr, "DEBUG: &actual.value.string_value = %p\n", &actual.value.string_value);
fprintf(stderr, "DEBUG: actual.value.integer_value = 0x%lx\n", actual.value.integer_value);
fprintf(stderr, "DEBUG: actual.value.pointer_value = %p\n", actual.value.pointer_value);
fprintf(stderr, "DEBUG: actual.value.string_value = 0x%p\n", actual.value.string_value);
fprintf(stderr, "DEBUG: actual.value.string_value = %p\n", actual.value.string_value);
fprintf(stderr, "DEBUG: size_of_expected_value = %ld\n", constraint->size_of_expected_value);
fprintf(stderr, "DEBUG: *(int *)&actual.value.integer_value = %d\n", *(int*)&actual.value.integer_value);
fprintf(stderr, "DEBUG: *(int *)(&actual.value.integer_value+offset) = %d\n", *(int*)(&actual.value.integer_value+offset));
memmove(constraint->expected_value.value.pointer_value, start_address, constraint->size_of_expected_value);

} else
Expand Down
1 change: 1 addition & 0 deletions tests/mocks_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ Ensure(Mocks, can_capture_parameter) {
int captured_second = 0;

fprintf(stderr, "DEBUG: address to captured_first = %p\n", &captured_first);
fprintf(stderr, "DEBUG: address to captured_second = %p\n", &captured_second);

expect(simple_mocked_function,
will_capture_parameter(first, captured_first),
Expand Down

0 comments on commit c9343fe

Please sign in to comment.