meekrosoft / fff

A testing micro framework for creating function test doubles
Other
761 stars 167 forks source link

FUNCNAME##_reset() conflicts with existing functions #69

Open davix opened 5 years ago

davix commented 5 years ago

Describe the bug I have two functions: foobar_testcli() and foobar_testcli_reset() in my foobar.h

fff will generate below fake functions: DECLARE_FAKE_VALUE_FUNC3(int, foobar_testcli, foo_info_t, int, int); DECLARE_FAKE_VOID_FUNC1(foobar_testcli_reset, foo_info_t);

But first DECLARE_FAKE_VALUE_FUNC3() internally has a FUNCNAME##_reset() that conflicts with my existing foobar_testcli_reset().

Am I missing some options to bypass this?

meekrosoft commented 5 years ago

Hi @davix,

Yes, this is unfortunate. We should prefix internal fff functions with fff_ or something similar to put our functions in a namespace of sorts.

I think we can fix this pretty easily. Watch this space.

davix commented 5 years ago

Thank you @meekrosoft. Any workaround in this case?