mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-24 08:51:36 +01:00
Added parentheses around all macro parameters to resolve MISRA 2004 rule 19.10, "in the definition of a function-like macro, each instance of a parameter shall be enclosed in parenthesis" as tested with the IAR EW for 8051 compiler, version 9.20.2. The only questionable change is in "unity_fixture.h" where the nested macro DECLARE_TEST_CASE in RUN_TEST_CASE prevents surrounding params "group" and "name" with parentheses. However, it appears that macro DECLARE_TEST_CASE isn't used elsewhere, so I eliminated DECLARE_TEST_CASE and put its expansion directly in RUN_TEST_CASE. Now the following header files pass rule 19.10: * unity.h * unity_internals.h * unity_fixture.h For my own project, this change to the Unity test framework allows me to include my unit test code to be tested against MISRA rules as well, instead of just production code, to help enforce style and team guidelines.
Copyright (c) 2010 James Grenning and Contributed to Unity Project Unity Project - A Test Framework for C Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] This Framework is an optional add-on to Unity. By including unity_framework.h in place of unity.h, you may now work with Unity in a manner similar to CppUTest. This framework adds the concepts of test groups and gives finer control of your tests over the command line.