| 1 | #include <cgreen/cgreen.h> |
| 2 | #include <cgreen/mocks.h> |
| 3 | |
| 4 | struct structure { |
| 5 | int field; |
| 6 | char *string; |
| 7 | }; |
| 8 | |
| 9 | void update_field(struct structure *struct_to_update) { |
| 10 | int *field = &struct_to_update->field; |
| 11 | mock(struct_to_update, field); |
| 12 | } |
| 13 | |
| 14 | Ensure(setting_field_of_parameter) { |
| 15 | int fourty_two = 42; |
| 16 | expect(update_field, |
| 17 | will_set_contents_of_output_parameter(field, &fourty_two, sizeof(int))); |
| 18 | } |