Skip to content

Commit

Permalink
Merge pull request #77 from henningrehn/return_value_history_for_cust…
Browse files Browse the repository at this point in the history
…om_fakes

Handle return value history for custom fakes
  • Loading branch information
Mike Long authored Aug 21, 2019
2 parents ab47e7f + b9f11dc commit 7e09f07
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 43 deletions.
9 changes: 8 additions & 1 deletion fakegen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,14 @@ def output_function_body(arg_count, has_varargs, is_value_function)
putd_backslash "}"
}
putd_backslash "}"
putd_backslash "if (FUNCNAME##_fake.custom_fake) #{return_type}FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)});"
putd_backslash "if (FUNCNAME##_fake.custom_fake){ "
indent {
putd_backslash "RETURN_TYPE ret = FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)});" unless not is_value_function
putd_backslash "SAVE_RET_HISTORY(FUNCNAME, ret);" unless not is_value_function
putd_backslash "return ret;" unless not is_value_function
putd_backslash "#{return_type}FUNCNAME##_fake.custom_fake(#{arg_list(arg_count)});"
}
putd_backslash "}"
end

putd_backslash "RETURN_FAKE_RESULT(FUNCNAME)" if is_value_function
Expand Down
Loading

0 comments on commit 7e09f07

Please sign in to comment.