1
0
mirror of https://github.com/meekrosoft/fff synced 2026-01-23 00:15:59 +01:00

Add support to return the return value from custom fakes when it is a non-void function

This commit is contained in:
Mike Long
2012-07-06 01:36:52 +08:00
parent 1aa823ea2b
commit 4edb01b8f9
2 changed files with 24 additions and 21 deletions

View File

@@ -280,8 +280,11 @@ def output_function_body(arg_count, is_value_function)
putd " HISTORY_DROPPED(FUNCNAME);\\"
putd "}\\"
putd "INCREMENT_CALL_COUNT(FUNCNAME); \\"
putd "if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)}); \\"
putd "REGISTER_CALL(FUNCNAME); \\"
return_type = is_value_function ? "return" : ""
putd "if (FUNCNAME##_fake.custom_fake) #{return_type} FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)}); \\"
putd "RETURN_FAKE_RESULT(FUNCNAME) \\" if is_value_function
end