Skip to content

Conversation

@adbancroft
Copy link
Contributor

This PR combines a number of changes to ultimately have a reliable unit test of ArduinoFakeContext::Reset():

  1. Remove all heap allocation - simpler, more reliable and aligns with modern C++ code style ("Always use automatic variables unless you have a compelling reason or requirement not to")
  2. Replace behavior in macros with classes - allows for unit testing the behavior (see ProxiedArduinoFake_t and OverrideableProxiedArduinoFake_t)
  3. Limit scope of accessor generating macros _ArduinoFakeInstanceGetter1 & _ArduinoFakeInstanceGetter2. Not strictly necessary for the PR but is good practice.
  4. Makefile runs verbose tests (not strictly necessary for the PR but useful)
  5. Test harness returns number of failing tests, which will cause CTest to fail when tests fail (also not strictly necessary for the PR but useful).

The unit test of ArduinoFakeContext::Reset() tests behavior rather than implementation.

Fixes #80

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.

ArduinoContextTest::test_reset is failing

1 participant