mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-09-08 19:29:58 +00:00
Merge branch 'ThrowTheSwitch:master' into dev/gen-testrunner-use-begin-end-macro
This commit is contained in:
@@ -27,7 +27,7 @@ jobs:
|
|||||||
|
|
||||||
# Checks out repository under $GITHUB_WORKSPACE
|
# Checks out repository under $GITHUB_WORKSPACE
|
||||||
- name: Checkout Latest Repo
|
- name: Checkout Latest Repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Run Tests
|
# Run Tests
|
||||||
- name: Run All Unit Tests
|
- name: Run All Unit Tests
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Unity Test ![CI][]
|
# Unity Test ![CI][]
|
||||||
|
|
||||||
__Copyright (c) 2007 - 2023 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
|
__Copyright (c) 2007 - 2024 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
|
||||||
|
|
||||||
Welcome to the Unity Test Project, one of the main projects of ThrowTheSwitch.org.
|
Welcome to the Unity Test Project, one of the main projects of ThrowTheSwitch.org.
|
||||||
Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains.
|
Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
|
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
|
||||||
{
|
{
|
||||||
Unity.CurrentTestName = name;
|
Unity.CurrentTestName = name;
|
||||||
Unity.CurrentTestLineNumber = line_num;
|
Unity.CurrentTestLineNumber = (UNITY_UINT) line_num;
|
||||||
#ifdef UNITY_USE_COMMAND_LINE_ARGS
|
#ifdef UNITY_USE_COMMAND_LINE_ARGS
|
||||||
if (!UnityTestMatches())
|
if (!UnityTestMatches())
|
||||||
return;
|
return;
|
||||||
|
|||||||
+2
-2
@@ -2351,7 +2351,7 @@ int UnityParseOptions(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
int IsStringInBiggerString(const char* longstring, const char* shortstring)
|
static int IsStringInBiggerString(const char* longstring, const char* shortstring)
|
||||||
{
|
{
|
||||||
const char* lptr = longstring;
|
const char* lptr = longstring;
|
||||||
const char* sptr = shortstring;
|
const char* sptr = shortstring;
|
||||||
@@ -2396,7 +2396,7 @@ int IsStringInBiggerString(const char* longstring, const char* shortstring)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
int UnityStringArgumentMatches(const char* str)
|
static int UnityStringArgumentMatches(const char* str)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
const char* ptr1;
|
const char* ptr1;
|
||||||
|
|||||||
@@ -875,11 +875,11 @@ int UnityTestMatches(void);
|
|||||||
* Test Asserts
|
* Test Asserts
|
||||||
*-------------------------------------------------------*/
|
*-------------------------------------------------------*/
|
||||||
|
|
||||||
#define UNITY_TEST_ASSERT(condition, line, message) do { if (condition) { /* nothing*/ } else { UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message)); } } while (0)
|
#define UNITY_TEST_ASSERT(condition, line, message) do { if (condition) { /* nothing*/ } else { UNITY_TEST_FAIL((line), (message)); } } while (0)
|
||||||
#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message))
|
#define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (line), (message))
|
||||||
#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message))
|
#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (line), (message))
|
||||||
#define UNITY_TEST_ASSERT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (UNITY_LINE_TYPE)(line), (message))
|
#define UNITY_TEST_ASSERT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) == 0), (line), (message))
|
||||||
#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (UNITY_LINE_TYPE)(line), (message))
|
#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (line), (message))
|
||||||
|
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
|
#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
|
#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
|
||||||
|
|||||||
@@ -300,8 +300,8 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
|||||||
startFlushSpy();
|
startFlushSpy();
|
||||||
savedGetFlushSpyCalls = getFlushSpyCalls();
|
savedGetFlushSpyCalls = getFlushSpyCalls();
|
||||||
UnityConcludeTest();
|
UnityConcludeTest();
|
||||||
TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls);
|
|
||||||
endPutcharSpy();
|
endPutcharSpy();
|
||||||
|
TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls);
|
||||||
TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures);
|
TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures);
|
||||||
#if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION)
|
#if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION)
|
||||||
TEST_ASSERT_EQUAL(1, getFlushSpyCalls());
|
TEST_ASSERT_EQUAL(1, getFlushSpyCalls());
|
||||||
|
|||||||
Reference in New Issue
Block a user