Skip to content

Clear previous fake function behaviors before setting new ones#143

Open
sung-gon-kim wants to merge 1 commit into
meekrosoft:masterfrom
sung-gon-kim:feature/reset_fake_actions
Open

Clear previous fake function behaviors before setting new ones#143
sung-gon-kim wants to merge 1 commit into
meekrosoft:masterfrom
sung-gon-kim:feature/reset_fake_actions

Conversation

@sung-gon-kim
Copy link
Copy Markdown

When setting the behavior of a fake function, there are cases where previously registered behaviors need to be removed according to priority. Especially with test fixtures, these can sometimes be missed, which may lead to unintended behavior.

To prevent this, the following macros have been updated to clear any existing fake behaviors before applying new ones:

  • SET_RETURN_SEQ
  • SET_CUSTOM_FAKE_SEQ

Additionally, new macros have been introduced for setting return_val and custom_fake variables. These new macros also clear any previously registered behaviors before setting the new ones:

  • SET_RETURN_VAL
  • SET_CUSTOM_FAKE

These changes ensure that fake functions behaviors are always applied cleanly, avoiding conflicts or overlaps from prior configurations.

  • Your code builds clean without any errors or warnings
  • You are not breaking consistency
  • You have added unit tests
  • All tests and other checks pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant