mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 08:25:58 +01:00
Merge branch 'ThrowTheSwitch:master' into dev/gen-testrunner-use-begin-end-macro
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
|
||||
# Checks out repository under $GITHUB_WORKSPACE
|
||||
- name: Checkout Latest Repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Run Tests
|
||||
- name: Run All Unit Tests
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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.
|
||||
Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
|
||||
{
|
||||
Unity.CurrentTestName = name;
|
||||
Unity.CurrentTestLineNumber = line_num;
|
||||
Unity.CurrentTestLineNumber = (UNITY_UINT) line_num;
|
||||
#ifdef UNITY_USE_COMMAND_LINE_ARGS
|
||||
if (!UnityTestMatches())
|
||||
return;
|
||||
|
||||
@@ -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* 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;
|
||||
const char* ptr1;
|
||||
|
||||
@@ -875,11 +875,11 @@ int UnityTestMatches(void);
|
||||
* 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_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), (UNITY_LINE_TYPE)(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_NOT_EMPTY(pointer, line, message) UNITY_TEST_ASSERT(((pointer[0]) != 0), (UNITY_LINE_TYPE)(line), (message))
|
||||
#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), (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), (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_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();
|
||||
savedGetFlushSpyCalls = getFlushSpyCalls();
|
||||
UnityConcludeTest();
|
||||
TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls);
|
||||
endPutcharSpy();
|
||||
TEST_ASSERT_EQUAL(0, savedGetFlushSpyCalls);
|
||||
TEST_ASSERT_EQUAL(savedFailures + 1, Unity.TestFailures);
|
||||
#if defined(UNITY_OUTPUT_FLUSH) && defined(UNITY_OUTPUT_FLUSH_HEADER_DECLARATION)
|
||||
TEST_ASSERT_EQUAL(1, getFlushSpyCalls());
|
||||
|
||||
Reference in New Issue
Block a user