Microchip's XC16 and friends, when used with dsPICs, require that all pointers
to memory which could possibly be in EDS space by adorned with __eds__, e.g.
__eds__ int* p_int
Adding the macro UNITY_PTR_ATTRIBUTE allows Unity's pointers to be decorated
with whatever ridiculous attributes the compiler requires.
* Moved existing example to its own directory, with the intention of adding more examples
* Existing example uses its own .yml file instead of one of the files in targets/.
The tests which exercise TEST_ASSERT_EQUAL_MEMORY_ARRAY use int arrays,
and hard-code the size of each element as 4 bytes. This is of course
untrue on 16-bit platforms.
Replace this hard-coded value with sizeof(int).
Previously, TEST_ASSERT_EQUAL_HEX_ARRAY was being called, and passed
arrays of type 'unsigned int'. TEST_ASSERT_EQUAL_HEX_ARRAY is an alias
for TEST_ASSERT_EQUAL_HEX32_ARRAY in *all* cases (and is documented as
such), while 'unsigned int' is 16 bits on some platforms. Unsurprisingly
this caused some tests to fail.
Fix by replacing the 'unsigned int' declarations with '_UU32'.
This patch fixes testEqualIntArrays in the unity test suite on 16-bit
architectures.
TEST_ASSERT_EQUAL_INT_ARRAY calls UnityAssertEqualIntArray with 'style'
set to UNITY_DISPLAY_STYLE_INT.
UNITY_DISPLAY_STYLE_INT is defined as UNITY_DISPLAY_STYLE_AUTO +
UNITY_DISPLAY_STYLE_INT{16,32,64} (depending on the int width).
However, the switch statement in UnityAssertEqualIntArray has special
cases for the width-specific display styles, but these comparisons
are carried out without clearing the UNITY_DISPLAY_STYLE_AUTO flag.
This means that if 'style' is UNITY_DISPLAY_STYLE_INT, and the int
width is, say, 16, bits, the default case will be hit, and elements
compared as if they were 32 bits wide. Unsurprisingly this causes
a failure in the test named above.
Bug - compilation error when using parametrized tests with user defined types. When using TEST_CASE and parametrised test and passing parameters which are of user defined types, the test_runner does not compile because it does not recognize the user defined types.
Test runner should copy the include statements from the test file
Likewise, place all function prototypes before statements.
These changes support Microsoft Visual Studio 2008 Express Edition,
which follows C89-style rules.