| 1 | #include <cgreen/cgreen.h> |
| 2 | #include <cgreen/mocks.h> |
| 3 | |
| 4 | void do_stuff(void *stream1, void *stream2) {} |
| 5 | |
| 6 | Describe(Streams); |
| 7 | BeforeEach(Streams) {} |
| 8 | AfterEach(Streams) {} |
| 9 | |
| 10 | static int first_stream_stub(void *stream) { |
| 11 | return (int)mock(stream); |
| 12 | } |
| 13 | |
| 14 | static int second_stream_stub(void *stream) { |
| 15 | return (int)mock(stream); |
| 16 | } |
| 17 | |
| 18 | Ensure(Streams, good_test) { |
| 19 | expect(first_stream_stub, will_return('a')); |
| 20 | expect(second_stream_stub, will_return('a')); |
| 21 | do_stuff(&first_stream_stub, &second_stream_stub); |
| 22 | } |