From 7b3afcaf77f96e7d62f6cd1623ead7f17512d79f Mon Sep 17 00:00:00 2001 From: Omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 24 Feb 2024 22:47:46 +1100 Subject: repo init. partial port of existing code --- deps/Unity/examples/example_3/helper/UnityHelper.c | 10 ++++++++++ deps/Unity/examples/example_3/helper/UnityHelper.h | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 deps/Unity/examples/example_3/helper/UnityHelper.c create mode 100644 deps/Unity/examples/example_3/helper/UnityHelper.h (limited to 'deps/Unity/examples/example_3/helper') 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 +#include + +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 -- cgit v1.2.3-70-g09d2