diff options
author | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-24 22:47:46 +1100 |
---|---|---|
committer | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-24 22:47:46 +1100 |
commit | 7b3afcaf77f96e7d62f6cd1623ead7f17512d79f (patch) | |
tree | b5f82c64e9c06a84e4d095ab4ac48712e860b673 /deps/Unity/examples/example_3/helper | |
parent | b047be5252aeb981faea077409c1768fda0301d9 (diff) |
repo init. partial port of existing code
Diffstat (limited to 'deps/Unity/examples/example_3/helper')
-rw-r--r-- | deps/Unity/examples/example_3/helper/UnityHelper.c | 10 | ||||
-rw-r--r-- | deps/Unity/examples/example_3/helper/UnityHelper.h | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/deps/Unity/examples/example_3/helper/UnityHelper.c b/deps/Unity/examples/example_3/helper/UnityHelper.c new file mode 100644 index 0000000..9cf42c6 --- /dev/null +++ b/deps/Unity/examples/example_3/helper/UnityHelper.c @@ -0,0 +1,10 @@ +#include "unity.h" +#include "UnityHelper.h" +#include <stdio.h> +#include <string.h> + +void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line) +{ + UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x"); + UNITY_TEST_ASSERT_EQUAL_INT(expected.y, actual.y, line, "Example Struct Failed For Field y"); +} diff --git a/deps/Unity/examples/example_3/helper/UnityHelper.h b/deps/Unity/examples/example_3/helper/UnityHelper.h new file mode 100644 index 0000000..1516111 --- /dev/null +++ b/deps/Unity/examples/example_3/helper/UnityHelper.h @@ -0,0 +1,12 @@ +#ifndef _TESTHELPER_H +#define _TESTHELPER_H + +#include "Types.h" + +void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line); + +#define UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, line, message) AssertEqualExampleStruct(expected, actual, line); + +#define TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual) UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, __LINE__, NULL); + +#endif // _TESTHELPER_H |