mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-20 14:07:07 +08:00
Merge remote-tracking branch 'upstream/master'
Conflicts: examples/example_3/makefile
This commit is contained in:
@ -45,7 +45,7 @@ class UnityTestRunnerGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
#build runner file
|
#build runner file
|
||||||
generate(input_file, output_file, tests, used_mocks)
|
generate(input_file, output_file, tests, used_mocks, testfile_includes)
|
||||||
|
|
||||||
#determine which files were used to return them
|
#determine which files were used to return them
|
||||||
all_files_used = [input_file, output_file]
|
all_files_used = [input_file, output_file]
|
||||||
@ -54,9 +54,9 @@ class UnityTestRunnerGenerator
|
|||||||
return all_files_used.uniq
|
return all_files_used.uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate(input_file, output_file, tests, used_mocks)
|
def generate(input_file, output_file, tests, used_mocks, testfile_includes)
|
||||||
File.open(output_file, 'w') do |output|
|
File.open(output_file, 'w') do |output|
|
||||||
create_header(output, used_mocks)
|
create_header(output, used_mocks, testfile_includes)
|
||||||
create_externs(output, tests, used_mocks)
|
create_externs(output, tests, used_mocks)
|
||||||
create_mock_management(output, used_mocks)
|
create_mock_management(output, used_mocks)
|
||||||
create_suite_setup_and_teardown(output)
|
create_suite_setup_and_teardown(output)
|
||||||
@ -121,7 +121,10 @@ class UnityTestRunnerGenerator
|
|||||||
source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
|
source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
|
||||||
|
|
||||||
#parse out includes
|
#parse out includes
|
||||||
return source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten
|
includes = source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten
|
||||||
|
brackets_includes = source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten
|
||||||
|
brackets_includes.each { |inc| includes << '<' + inc +'>' }
|
||||||
|
return includes
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_mocks(includes)
|
def find_mocks(includes)
|
||||||
@ -132,7 +135,7 @@ class UnityTestRunnerGenerator
|
|||||||
return mock_headers
|
return mock_headers
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_header(output, mocks)
|
def create_header(output, mocks, testfile_includes)
|
||||||
output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
|
output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
|
||||||
create_runtest(output, mocks)
|
create_runtest(output, mocks)
|
||||||
output.puts("\n//=======Automagically Detected Files To Include=====")
|
output.puts("\n//=======Automagically Detected Files To Include=====")
|
||||||
@ -144,6 +147,11 @@ class UnityTestRunnerGenerator
|
|||||||
output.puts('#include <setjmp.h>')
|
output.puts('#include <setjmp.h>')
|
||||||
output.puts('#include <stdio.h>')
|
output.puts('#include <stdio.h>')
|
||||||
output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
|
output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
|
||||||
|
testfile_includes.delete("unity").delete("cmock")
|
||||||
|
testrunner_includes = testfile_includes - mocks
|
||||||
|
testrunner_includes.each do |inc|
|
||||||
|
output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}")
|
||||||
|
end
|
||||||
mocks.each do |mock|
|
mocks.each do |mock|
|
||||||
output.puts("#include \"#{mock.gsub('.h','')}.h\"")
|
output.puts("#include \"#{mock.gsub('.h','')}.h\"")
|
||||||
end
|
end
|
||||||
|
@ -13,40 +13,40 @@
|
|||||||
#include "unity_fixture_malloc_overrides.h"
|
#include "unity_fixture_malloc_overrides.h"
|
||||||
#include "unity_fixture_internals.h"
|
#include "unity_fixture_internals.h"
|
||||||
|
|
||||||
int UnityMain(int argc, char* argv[], void (*runAllTests)());
|
int UnityMain(int argc, char* argv[], void (*runAllTests)(void));
|
||||||
|
|
||||||
|
|
||||||
#define TEST_GROUP(group)\
|
#define TEST_GROUP(group)\
|
||||||
int TEST_GROUP_##group = 0
|
static const char* TEST_GROUP_##group = #group
|
||||||
|
|
||||||
#define TEST_SETUP(group) void TEST_##group##_SETUP()
|
#define TEST_SETUP(group) void TEST_##group##_SETUP(void)
|
||||||
|
|
||||||
#define TEST_TEAR_DOWN(group) void TEST_##group##_TEAR_DOWN()
|
#define TEST_TEAR_DOWN(group) void TEST_##group##_TEAR_DOWN(void)
|
||||||
|
|
||||||
|
|
||||||
#define TEST(group, name) \
|
#define TEST(group, name) \
|
||||||
void TEST_##group##_##name##_();\
|
void TEST_##group##_##name##_(void);\
|
||||||
void TEST_##group##_##name##_run()\
|
void TEST_##group##_##name##_run(void)\
|
||||||
{\
|
{\
|
||||||
UnityTestRunner(TEST_##group##_SETUP,\
|
UnityTestRunner(TEST_##group##_SETUP,\
|
||||||
TEST_##group##_##name##_,\
|
TEST_##group##_##name##_,\
|
||||||
TEST_##group##_TEAR_DOWN,\
|
TEST_##group##_TEAR_DOWN,\
|
||||||
"TEST(" #group ", " #name ")",\
|
"TEST(" #group ", " #name ")",\
|
||||||
#group, #name,\
|
TEST_GROUP_##group, #name,\
|
||||||
__FILE__, __LINE__);\
|
__FILE__, __LINE__);\
|
||||||
}\
|
}\
|
||||||
void TEST_##group##_##name##_()
|
void TEST_##group##_##name##_(void)
|
||||||
|
|
||||||
#define IGNORE_TEST(group, name) \
|
#define IGNORE_TEST(group, name) \
|
||||||
void TEST_##group##_##name##_();\
|
void TEST_##group##_##name##_(void);\
|
||||||
void TEST_##group##_##name##_run()\
|
void TEST_##group##_##name##_run(void)\
|
||||||
{\
|
{\
|
||||||
UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")");\
|
UnityIgnoreTest("IGNORE_TEST(" #group ", " #name ")");\
|
||||||
}\
|
}\
|
||||||
void TEST_##group##_##name##_()
|
void TEST_##group##_##name##_(void)
|
||||||
|
|
||||||
#define DECLARE_TEST_CASE(group, name) \
|
#define DECLARE_TEST_CASE(group, name) \
|
||||||
void TEST_##group##_##name##_run()
|
void TEST_##group##_##name##_run(void)
|
||||||
|
|
||||||
#define RUN_TEST_CASE(group, name) \
|
#define RUN_TEST_CASE(group, name) \
|
||||||
{ DECLARE_TEST_CASE(group, name);\
|
{ DECLARE_TEST_CASE(group, name);\
|
||||||
@ -54,8 +54,9 @@ int UnityMain(int argc, char* argv[], void (*runAllTests)());
|
|||||||
|
|
||||||
//This goes at the bottom of each test file or in a separate c file
|
//This goes at the bottom of each test file or in a separate c file
|
||||||
#define TEST_GROUP_RUNNER(group)\
|
#define TEST_GROUP_RUNNER(group)\
|
||||||
void TEST_##group##_GROUP_RUNNER_runAll();\
|
void TEST_##group##_GROUP_RUNNER_runAll(void);\
|
||||||
void TEST_##group##_GROUP_RUNNER()\
|
void TEST_##group##_GROUP_RUNNER(void);\
|
||||||
|
void TEST_##group##_GROUP_RUNNER(void)\
|
||||||
{\
|
{\
|
||||||
TEST_##group##_GROUP_RUNNER_runAll();\
|
TEST_##group##_GROUP_RUNNER_runAll();\
|
||||||
}\
|
}\
|
||||||
@ -63,7 +64,7 @@ int UnityMain(int argc, char* argv[], void (*runAllTests)());
|
|||||||
|
|
||||||
//Call this from main
|
//Call this from main
|
||||||
#define RUN_TEST_GROUP(group)\
|
#define RUN_TEST_GROUP(group)\
|
||||||
{ void TEST_##group##_GROUP_RUNNER();\
|
{ void TEST_##group##_GROUP_RUNNER(void);\
|
||||||
TEST_##group##_GROUP_RUNNER(); }
|
TEST_##group##_GROUP_RUNNER(); }
|
||||||
|
|
||||||
//CppUTest Compatibility Macros
|
//CppUTest Compatibility Macros
|
||||||
|
4
makefile
4
makefile
@ -17,7 +17,9 @@ SRC_FILES=src/unity.c test/testunity.c build/testunity_Runner.c
|
|||||||
INC_DIRS=-Isrc
|
INC_DIRS=-Isrc
|
||||||
SYMBOLS=-DTEST -DUNITY_SUPPORT_64
|
SYMBOLS=-DTEST -DUNITY_SUPPORT_64
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OSTYPE),cygwin)
|
||||||
|
CLEANUP = rm -f build/*.o ; rm -f $(TARGET) ; mkdir -p build
|
||||||
|
else ifeq ($(OS),Windows_NT)
|
||||||
CLEANUP = del /F /Q build\* && del /F /Q $(TARGET)
|
CLEANUP = del /F /Q build\* && del /F /Q $(TARGET)
|
||||||
else
|
else
|
||||||
CLEANUP = rm -f build/*.o ; rm -f $(TARGET) ; mkdir -p build
|
CLEANUP = rm -f build/*.o ; rm -f $(TARGET) ; mkdir -p build
|
||||||
|
118
src/unity.c
118
src/unity.c
@ -14,7 +14,7 @@
|
|||||||
#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
|
#define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
|
||||||
#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); }
|
#define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\n'); }
|
||||||
|
|
||||||
struct _Unity Unity = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , { 0 } };
|
struct _Unity Unity = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , {{{ 0 }}} };
|
||||||
|
|
||||||
const char* UnityStrNull = "NULL";
|
const char* UnityStrNull = "NULL";
|
||||||
const char* UnityStrSpacer = ". ";
|
const char* UnityStrSpacer = ". ";
|
||||||
@ -42,7 +42,7 @@ static const _UD d_zero = 0.0;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// compiler-generic print formatting masks
|
// compiler-generic print formatting masks
|
||||||
const _U_UINT UnitySizeMask[] =
|
const _U_UINT UnitySizeMask[] =
|
||||||
{
|
{
|
||||||
255u, // 0xFF
|
255u, // 0xFF
|
||||||
65535u, // 0xFFFF
|
65535u, // 0xFFFF
|
||||||
@ -308,7 +308,7 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnityPrint(UnityStrNull);
|
UnityPrint(UnityStrNull);
|
||||||
}
|
}
|
||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
if (actual != NULL)
|
if (actual != NULL)
|
||||||
@ -319,7 +319,7 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnityPrint(UnityStrNull);
|
UnityPrint(UnityStrNull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,12 +327,12 @@ void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual
|
|||||||
// Assertion & Control Helpers
|
// Assertion & Control Helpers
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
|
||||||
int UnityCheckArraysForNull(const void* expected, const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
int UnityCheckArraysForNull(UNITY_PTR_ATTRIBUTE const void* expected, UNITY_PTR_ATTRIBUTE const void* actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
|
||||||
{
|
{
|
||||||
//return true if they are both NULL
|
//return true if they are both NULL
|
||||||
if ((expected == NULL) && (actual == NULL))
|
if ((expected == NULL) && (actual == NULL))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
//throw error if just expected is NULL
|
//throw error if just expected is NULL
|
||||||
if (expected == NULL)
|
if (expected == NULL)
|
||||||
{
|
{
|
||||||
@ -350,7 +350,7 @@ int UnityCheckArraysForNull(const void* expected, const void* actual, const UNIT
|
|||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//return false if neither is NULL
|
//return false if neither is NULL
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -366,7 +366,7 @@ void UnityAssertBits(const _U_SINT mask,
|
|||||||
const UNITY_LINE_TYPE lineNumber)
|
const UNITY_LINE_TYPE lineNumber)
|
||||||
{
|
{
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if ((mask & expected) != (mask & actual))
|
if ((mask & expected) != (mask & actual))
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
@ -401,19 +401,19 @@ void UnityAssertEqualNumber(const _U_SINT expected,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
void UnityAssertEqualIntArray(const _U_SINT* expected,
|
void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
|
||||||
const _U_SINT* actual,
|
UNITY_PTR_ATTRIBUTE const void* actual,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber,
|
const UNITY_LINE_TYPE lineNumber,
|
||||||
const UNITY_DISPLAY_STYLE_T style)
|
const UNITY_DISPLAY_STYLE_T style)
|
||||||
{
|
{
|
||||||
_UU32 elements = num_elements;
|
_UU32 elements = num_elements;
|
||||||
const _US8* ptr_exp = (_US8*)expected;
|
UNITY_PTR_ATTRIBUTE const _US8* ptr_exp = (UNITY_PTR_ATTRIBUTE _US8*)expected;
|
||||||
const _US8* ptr_act = (_US8*)actual;
|
UNITY_PTR_ATTRIBUTE const _US8* ptr_act = (UNITY_PTR_ATTRIBUTE _US8*)actual;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if (elements == 0)
|
if (elements == 0)
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
@ -421,8 +421,8 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case
|
// If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case
|
||||||
@ -456,15 +456,15 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|||||||
case UNITY_DISPLAY_STYLE_UINT16:
|
case UNITY_DISPLAY_STYLE_UINT16:
|
||||||
while (elements--)
|
while (elements--)
|
||||||
{
|
{
|
||||||
if (*(_US16*)ptr_exp != *(_US16*)ptr_act)
|
if (*(UNITY_PTR_ATTRIBUTE _US16*)ptr_exp != *(UNITY_PTR_ATTRIBUTE _US16*)ptr_act)
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrint(UnityStrElement);
|
UnityPrint(UnityStrElement);
|
||||||
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
||||||
UnityPrint(UnityStrExpected);
|
UnityPrint(UnityStrExpected);
|
||||||
UnityPrintNumberByStyle(*(_US16*)ptr_exp, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US16*)ptr_exp, style);
|
||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(_US16*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US16*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
@ -478,15 +478,15 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|||||||
case UNITY_DISPLAY_STYLE_UINT64:
|
case UNITY_DISPLAY_STYLE_UINT64:
|
||||||
while (elements--)
|
while (elements--)
|
||||||
{
|
{
|
||||||
if (*(_US64*)ptr_exp != *(_US64*)ptr_act)
|
if (*(UNITY_PTR_ATTRIBUTE _US64*)ptr_exp != *(UNITY_PTR_ATTRIBUTE _US64*)ptr_act)
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrint(UnityStrElement);
|
UnityPrint(UnityStrElement);
|
||||||
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
||||||
UnityPrint(UnityStrExpected);
|
UnityPrint(UnityStrExpected);
|
||||||
UnityPrintNumberByStyle(*(_US64*)ptr_exp, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US64*)ptr_exp, style);
|
||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(_US64*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US64*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
@ -498,15 +498,15 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|||||||
default:
|
default:
|
||||||
while (elements--)
|
while (elements--)
|
||||||
{
|
{
|
||||||
if (*(_US32*)ptr_exp != *(_US32*)ptr_act)
|
if (*(UNITY_PTR_ATTRIBUTE _US32*)ptr_exp != *(UNITY_PTR_ATTRIBUTE _US32*)ptr_act)
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrint(UnityStrElement);
|
UnityPrint(UnityStrElement);
|
||||||
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
|
||||||
UnityPrint(UnityStrExpected);
|
UnityPrint(UnityStrExpected);
|
||||||
UnityPrintNumberByStyle(*(_US32*)ptr_exp, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US32*)ptr_exp, style);
|
||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(_US32*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE _US32*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
@ -519,19 +519,19 @@ void UnityAssertEqualIntArray(const _U_SINT* expected,
|
|||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
#ifndef UNITY_EXCLUDE_FLOAT
|
#ifndef UNITY_EXCLUDE_FLOAT
|
||||||
void UnityAssertEqualFloatArray(const _UF* expected,
|
void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
|
||||||
const _UF* actual,
|
UNITY_PTR_ATTRIBUTE const _UF* actual,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber)
|
const UNITY_LINE_TYPE lineNumber)
|
||||||
{
|
{
|
||||||
_UU32 elements = num_elements;
|
_UU32 elements = num_elements;
|
||||||
const _UF* ptr_expected = expected;
|
UNITY_PTR_ATTRIBUTE const _UF* ptr_expected = expected;
|
||||||
const _UF* ptr_actual = actual;
|
UNITY_PTR_ATTRIBUTE const _UF* ptr_actual = actual;
|
||||||
_UF diff, tol;
|
_UF diff, tol;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if (elements == 0)
|
if (elements == 0)
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
@ -539,8 +539,8 @@ void UnityAssertEqualFloatArray(const _UF* expected,
|
|||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (elements--)
|
while (elements--)
|
||||||
@ -551,7 +551,7 @@ void UnityAssertEqualFloatArray(const _UF* expected,
|
|||||||
tol = UNITY_FLOAT_PRECISION * *ptr_expected;
|
tol = UNITY_FLOAT_PRECISION * *ptr_expected;
|
||||||
if (tol < 0.0f)
|
if (tol < 0.0f)
|
||||||
tol = 0.0f - tol;
|
tol = 0.0f - tol;
|
||||||
|
|
||||||
//This first part of this condition will catch any NaN or Infinite values
|
//This first part of this condition will catch any NaN or Infinite values
|
||||||
if ((diff * 0.0f != 0.0f) || (diff > tol))
|
if ((diff * 0.0f != 0.0f) || (diff > tol))
|
||||||
{
|
{
|
||||||
@ -585,7 +585,7 @@ void UnityAssertFloatsWithin(const _UF delta,
|
|||||||
_UF pos_delta = delta;
|
_UF pos_delta = delta;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if (diff < 0.0f)
|
if (diff < 0.0f)
|
||||||
{
|
{
|
||||||
diff = 0.0f - diff;
|
diff = 0.0f - diff;
|
||||||
@ -691,19 +691,19 @@ void UnityAssertFloatIsNaN(const _UF actual,
|
|||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
#ifndef UNITY_EXCLUDE_DOUBLE
|
#ifndef UNITY_EXCLUDE_DOUBLE
|
||||||
void UnityAssertEqualDoubleArray(const _UD* expected,
|
void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
|
||||||
const _UD* actual,
|
UNITY_PTR_ATTRIBUTE const _UD* actual,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber)
|
const UNITY_LINE_TYPE lineNumber)
|
||||||
{
|
{
|
||||||
_UU32 elements = num_elements;
|
_UU32 elements = num_elements;
|
||||||
const _UD* ptr_expected = expected;
|
UNITY_PTR_ATTRIBUTE const _UD* ptr_expected = expected;
|
||||||
const _UD* ptr_actual = actual;
|
UNITY_PTR_ATTRIBUTE const _UD* ptr_actual = actual;
|
||||||
_UD diff, tol;
|
_UD diff, tol;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if (elements == 0)
|
if (elements == 0)
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
@ -711,8 +711,8 @@ void UnityAssertEqualDoubleArray(const _UD* expected,
|
|||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (elements--)
|
while (elements--)
|
||||||
@ -723,7 +723,7 @@ void UnityAssertEqualDoubleArray(const _UD* expected,
|
|||||||
tol = UNITY_DOUBLE_PRECISION * *ptr_expected;
|
tol = UNITY_DOUBLE_PRECISION * *ptr_expected;
|
||||||
if (tol < 0.0)
|
if (tol < 0.0)
|
||||||
tol = 0.0 - tol;
|
tol = 0.0 - tol;
|
||||||
|
|
||||||
//This first part of this condition will catch any NaN or Infinite values
|
//This first part of this condition will catch any NaN or Infinite values
|
||||||
if ((diff * 0.0 != 0.0) || (diff > tol))
|
if ((diff * 0.0 != 0.0) || (diff > tol))
|
||||||
{
|
{
|
||||||
@ -757,7 +757,7 @@ void UnityAssertDoublesWithin(const _UD delta,
|
|||||||
_UD pos_delta = delta;
|
_UD pos_delta = delta;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if (diff < 0.0)
|
if (diff < 0.0)
|
||||||
{
|
{
|
||||||
diff = 0.0 - diff;
|
diff = 0.0 - diff;
|
||||||
@ -866,7 +866,7 @@ void UnityAssertNumbersWithin( const _U_SINT delta,
|
|||||||
const UNITY_DISPLAY_STYLE_T style)
|
const UNITY_DISPLAY_STYLE_T style)
|
||||||
{
|
{
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
|
||||||
{
|
{
|
||||||
if (actual > expected)
|
if (actual > expected)
|
||||||
@ -905,7 +905,7 @@ void UnityAssertEqualString(const char* expected,
|
|||||||
_UU32 i;
|
_UU32 i;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
// if both pointers not null compare the strings
|
// if both pointers not null compare the strings
|
||||||
if (expected && actual)
|
if (expected && actual)
|
||||||
{
|
{
|
||||||
@ -943,9 +943,9 @@ void UnityAssertEqualStringArray( const char** expected,
|
|||||||
const UNITY_LINE_TYPE lineNumber)
|
const UNITY_LINE_TYPE lineNumber)
|
||||||
{
|
{
|
||||||
_UU32 i, j = 0;
|
_UU32 i, j = 0;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
// if no elements, it's an error
|
// if no elements, it's an error
|
||||||
if (num_elements == 0)
|
if (num_elements == 0)
|
||||||
{
|
{
|
||||||
@ -955,9 +955,9 @@ void UnityAssertEqualStringArray( const char** expected,
|
|||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// if both pointers not null compare the strings
|
// if both pointers not null compare the strings
|
||||||
@ -991,25 +991,25 @@ void UnityAssertEqualStringArray( const char** expected,
|
|||||||
UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j]));
|
UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j]));
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
} while (++j < num_elements);
|
} while (++j < num_elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
void UnityAssertEqualMemory( const void* expected,
|
void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected,
|
||||||
const void* actual,
|
UNITY_PTR_ATTRIBUTE const void* actual,
|
||||||
const _UU32 length,
|
const _UU32 length,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber)
|
const UNITY_LINE_TYPE lineNumber)
|
||||||
{
|
{
|
||||||
unsigned char* ptr_exp = (unsigned char*)expected;
|
UNITY_PTR_ATTRIBUTE unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE unsigned char*)expected;
|
||||||
unsigned char* ptr_act = (unsigned char*)actual;
|
UNITY_PTR_ATTRIBUTE unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE unsigned char*)actual;
|
||||||
_UU32 elements = num_elements;
|
_UU32 elements = num_elements;
|
||||||
_UU32 bytes;
|
_UU32 bytes;
|
||||||
|
|
||||||
UNITY_SKIP_EXECUTION;
|
UNITY_SKIP_EXECUTION;
|
||||||
|
|
||||||
if ((elements == 0) || (length == 0))
|
if ((elements == 0) || (length == 0))
|
||||||
{
|
{
|
||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
@ -1018,9 +1018,9 @@ void UnityAssertEqualMemory( const void* expected,
|
|||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityCheckArraysForNull((void*)expected, (void*)actual, lineNumber, msg) == 1)
|
if (UnityCheckArraysForNull((UNITY_PTR_ATTRIBUTE void*)expected, (UNITY_PTR_ATTRIBUTE void*)actual, lineNumber, msg) == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (elements--)
|
while (elements--)
|
||||||
{
|
{
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
@ -1049,7 +1049,7 @@ void UnityAssertEqualMemory( const void* expected,
|
|||||||
ptr_act += 1;
|
ptr_act += 1;
|
||||||
}
|
}
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1068,7 +1068,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
UNITY_OUTPUT_CHAR(':');
|
UNITY_OUTPUT_CHAR(':');
|
||||||
if (msg[0] != ' ')
|
if (msg[0] != ' ')
|
||||||
{
|
{
|
||||||
UNITY_OUTPUT_CHAR(' ');
|
UNITY_OUTPUT_CHAR(' ');
|
||||||
}
|
}
|
||||||
UnityPrint(msg);
|
UnityPrint(msg);
|
||||||
}
|
}
|
||||||
@ -1098,7 +1098,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
|
|||||||
{
|
{
|
||||||
Unity.CurrentTestName = FuncName;
|
Unity.CurrentTestName = FuncName;
|
||||||
Unity.CurrentTestLineNumber = FuncLineNum;
|
Unity.CurrentTestLineNumber = FuncLineNum;
|
||||||
Unity.NumberOfTests++;
|
Unity.NumberOfTests++;
|
||||||
if (TEST_PROTECT())
|
if (TEST_PROTECT())
|
||||||
{
|
{
|
||||||
setUp();
|
setUp();
|
||||||
|
@ -173,11 +173,15 @@ typedef _US64 _U_SINT;
|
|||||||
#error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported)
|
#error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef UNITY_PTR_ATTRIBUTE
|
||||||
|
#define UNITY_PTR_ATTRIBUTE
|
||||||
|
#endif
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Float Support
|
// Float Support
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
||||||
#ifdef UNITY_EXCLUDE_FLOAT
|
#ifdef UNITY_EXCLUDE_FLOAT
|
||||||
|
|
||||||
//No Floating Point Support
|
//No Floating Point Support
|
||||||
#undef UNITY_FLOAT_PRECISION
|
#undef UNITY_FLOAT_PRECISION
|
||||||
@ -194,7 +198,7 @@ typedef _US64 _U_SINT;
|
|||||||
#define UNITY_FLOAT_TYPE float
|
#define UNITY_FLOAT_TYPE float
|
||||||
#endif
|
#endif
|
||||||
typedef UNITY_FLOAT_TYPE _UF;
|
typedef UNITY_FLOAT_TYPE _UF;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
@ -208,7 +212,7 @@ typedef UNITY_FLOAT_TYPE _UF;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UNITY_EXCLUDE_DOUBLE
|
#ifdef UNITY_EXCLUDE_DOUBLE
|
||||||
|
|
||||||
//No Floating Point Support
|
//No Floating Point Support
|
||||||
#undef UNITY_DOUBLE_PRECISION
|
#undef UNITY_DOUBLE_PRECISION
|
||||||
@ -219,13 +223,13 @@ typedef UNITY_FLOAT_TYPE _UF;
|
|||||||
|
|
||||||
//Floating Point Support
|
//Floating Point Support
|
||||||
#ifndef UNITY_DOUBLE_PRECISION
|
#ifndef UNITY_DOUBLE_PRECISION
|
||||||
#define UNITY_DOUBLE_PRECISION (1e-12f)
|
#define UNITY_DOUBLE_PRECISION (1e-12f)
|
||||||
#endif
|
#endif
|
||||||
#ifndef UNITY_DOUBLE_TYPE
|
#ifndef UNITY_DOUBLE_TYPE
|
||||||
#define UNITY_DOUBLE_TYPE double
|
#define UNITY_DOUBLE_TYPE double
|
||||||
#endif
|
#endif
|
||||||
typedef UNITY_DOUBLE_TYPE _UD;
|
typedef UNITY_DOUBLE_TYPE _UD;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
@ -354,8 +358,8 @@ void UnityAssertEqualNumber(const _U_SINT expected,
|
|||||||
const UNITY_LINE_TYPE lineNumber,
|
const UNITY_LINE_TYPE lineNumber,
|
||||||
const UNITY_DISPLAY_STYLE_T style);
|
const UNITY_DISPLAY_STYLE_T style);
|
||||||
|
|
||||||
void UnityAssertEqualIntArray(const _U_SINT* expected,
|
void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
|
||||||
const _U_SINT* actual,
|
UNITY_PTR_ATTRIBUTE const void* actual,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber,
|
const UNITY_LINE_TYPE lineNumber,
|
||||||
@ -378,8 +382,8 @@ void UnityAssertEqualStringArray( const char** expected,
|
|||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber);
|
const UNITY_LINE_TYPE lineNumber);
|
||||||
|
|
||||||
void UnityAssertEqualMemory( const void* expected,
|
void UnityAssertEqualMemory( UNITY_PTR_ATTRIBUTE const void* expected,
|
||||||
const void* actual,
|
UNITY_PTR_ATTRIBUTE const void* actual,
|
||||||
const _UU32 length,
|
const _UU32 length,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
@ -403,8 +407,8 @@ void UnityAssertFloatsWithin(const _UF delta,
|
|||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber);
|
const UNITY_LINE_TYPE lineNumber);
|
||||||
|
|
||||||
void UnityAssertEqualFloatArray(const _UF* expected,
|
void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
|
||||||
const _UF* actual,
|
UNITY_PTR_ATTRIBUTE const _UF* actual,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber);
|
const UNITY_LINE_TYPE lineNumber);
|
||||||
@ -429,8 +433,8 @@ void UnityAssertDoublesWithin(const _UD delta,
|
|||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber);
|
const UNITY_LINE_TYPE lineNumber);
|
||||||
|
|
||||||
void UnityAssertEqualDoubleArray(const _UD* expected,
|
void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
|
||||||
const _UD* actual,
|
UNITY_PTR_ATTRIBUTE const _UD* actual,
|
||||||
const _UU32 num_elements,
|
const _UU32 num_elements,
|
||||||
const char* msg,
|
const char* msg,
|
||||||
const UNITY_LINE_TYPE lineNumber);
|
const UNITY_LINE_TYPE lineNumber);
|
||||||
@ -484,30 +488,30 @@ void UnityAssertDoubleIsNaN(const _UD actual,
|
|||||||
|
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
|
#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)line)
|
#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)line)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((void*)(expected), (void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line)
|
#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)line)
|
||||||
|
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
|
#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8)
|
#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT8)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16)
|
#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT16)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32)
|
#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT32)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
|
#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8)
|
#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT8)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16)
|
#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT16)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32)
|
#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT32)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8)
|
#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX8)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16)
|
#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX16)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32)
|
#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(expected), (UNITY_PTR_ATTRIBUTE const void*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX32)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(_UP*)(expected), (const _U_SINT*)(_UP*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
|
#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const void*)(_UP*)(expected), (const void*)(_UP*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_POINTER)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((const char**)(expected), (const char**)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
|
#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((const char**)(expected), (const char**)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((void*)(expected), (void*)(actual), (_UU32)(len), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
|
#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_PTR_ATTRIBUTE void*)(expected), (UNITY_PTR_ATTRIBUTE void*)(actual), (_UU32)(len), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
|
||||||
|
|
||||||
#ifdef UNITY_SUPPORT_64
|
#ifdef UNITY_SUPPORT_64
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64)
|
#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64)
|
#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
|
#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64)
|
#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT64)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64)
|
#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_UINT64)
|
||||||
#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((const _U_SINT*)(expected), (const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
|
#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_PTR_ATTRIBUTE const _U_SINT*)(expected), (UNITY_PTR_ATTRIBUTE const _U_SINT*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
|
||||||
#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
|
#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_HEX64)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,54 +1,57 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
|
#include "funky.h"
|
||||||
//=======External Functions This Runner Calls=====
|
#include "stanky.h"
|
||||||
extern void setUp(void);
|
#include <setjmp.h>
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Test Reset Option=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
void resetTest()
|
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
//=======MAIN=====
|
||||||
UnityBegin();
|
int main(void)
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
{
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,50 +1,53 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "funky.h"
|
||||||
//=======External Functions This Runner Calls=====
|
#include "stanky.h"
|
||||||
extern void setUp(void);
|
#include <setjmp.h>
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Test Reset Option=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
void resetTest()
|
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
//=======MAIN=====
|
||||||
UnityBegin();
|
int main(void)
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
{
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,76 +1,78 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
//=======External Functions This Runner Calls=====
|
#include "Mockstanky.h"
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
Mockstanky_Init();
|
static void CMock_Init(void)
|
||||||
}
|
{
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,72 +1,74 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
//=======External Functions This Runner Calls=====
|
#include "Mockstanky.h"
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
Mockstanky_Init();
|
static void CMock_Init(void)
|
||||||
}
|
{
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,85 +1,87 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include "one.h"
|
#include "one.h"
|
||||||
#include "two.h"
|
#include "two.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
int GlobalExpectCount;
|
#include "Mockstanky.h"
|
||||||
int GlobalVerifyOrder;
|
|
||||||
char* GlobalOrderError;
|
int GlobalExpectCount;
|
||||||
|
int GlobalVerifyOrder;
|
||||||
//=======External Functions This Runner Calls=====
|
char* GlobalOrderError;
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
GlobalExpectCount = 0;
|
static void CMock_Init(void)
|
||||||
GlobalVerifyOrder = 0;
|
{
|
||||||
GlobalOrderError = NULL;
|
GlobalExpectCount = 0;
|
||||||
Mockstanky_Init();
|
GlobalVerifyOrder = 0;
|
||||||
}
|
GlobalOrderError = NULL;
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,85 +1,87 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
//=======External Functions This Runner Calls=====
|
#include "Mockstanky.h"
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
Mockstanky_Init();
|
static void CMock_Init(void)
|
||||||
}
|
{
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Suite Setup=====
|
}
|
||||||
static int suite_setup(void)
|
|
||||||
{
|
//=======Suite Setup=====
|
||||||
a_custom_setup();
|
static int suite_setup(void)
|
||||||
}
|
{
|
||||||
|
a_custom_setup();
|
||||||
//=======Suite Teardown=====
|
}
|
||||||
static int suite_teardown(int num_failures)
|
|
||||||
{
|
//=======Suite Teardown=====
|
||||||
a_custom_teardown();
|
static int suite_teardown(int num_failures)
|
||||||
}
|
{
|
||||||
|
a_custom_teardown();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
suite_setup();
|
int main(void)
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
{
|
||||||
UnityBegin();
|
suite_setup();
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return suite_teardown(UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return suite_teardown(UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,73 +1,75 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST_NO_ARGS
|
#define RUN_TEST_NO_ARGS
|
||||||
#define RUN_TEST(TestFunc, TestLineNum, ...) \
|
#define RUN_TEST(TestFunc, TestLineNum, ...) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \
|
Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(__VA_ARGS__); \
|
TestFunc(__VA_ARGS__); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
//=======External Functions This Runner Calls=====
|
#include "Mockstanky.h"
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
Mockstanky_Init();
|
static void CMock_Init(void)
|
||||||
}
|
{
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS);
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS);
|
||||||
}
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,85 +1,87 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include "one.h"
|
#include "one.h"
|
||||||
#include "two.h"
|
#include "two.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
int GlobalExpectCount;
|
#include "Mockstanky.h"
|
||||||
int GlobalVerifyOrder;
|
|
||||||
char* GlobalOrderError;
|
int GlobalExpectCount;
|
||||||
|
int GlobalVerifyOrder;
|
||||||
//=======External Functions This Runner Calls=====
|
char* GlobalOrderError;
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
GlobalExpectCount = 0;
|
static void CMock_Init(void)
|
||||||
GlobalVerifyOrder = 0;
|
{
|
||||||
GlobalOrderError = NULL;
|
GlobalExpectCount = 0;
|
||||||
Mockstanky_Init();
|
GlobalVerifyOrder = 0;
|
||||||
}
|
GlobalOrderError = NULL;
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,85 +1,87 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
//=======External Functions This Runner Calls=====
|
#include "Mockstanky.h"
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
Mockstanky_Init();
|
static void CMock_Init(void)
|
||||||
}
|
{
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Suite Setup=====
|
}
|
||||||
static int suite_setup(void)
|
|
||||||
{
|
//=======Suite Setup=====
|
||||||
a_custom_setup();
|
static int suite_setup(void)
|
||||||
}
|
{
|
||||||
|
a_custom_setup();
|
||||||
//=======Suite Teardown=====
|
}
|
||||||
static int suite_teardown(int num_failures)
|
|
||||||
{
|
//=======Suite Teardown=====
|
||||||
a_custom_teardown();
|
static int suite_teardown(int num_failures)
|
||||||
}
|
{
|
||||||
|
a_custom_teardown();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
suite_setup();
|
int main(void)
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
{
|
||||||
UnityBegin();
|
suite_setup();
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return suite_teardown(UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return suite_teardown(UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,86 +1,88 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
CMock_Init(); \
|
CMock_Init(); \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
CMock_Verify(); \
|
CMock_Verify(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
CMock_Destroy(); \
|
CMock_Destroy(); \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "cmock.h"
|
#include "cmock.h"
|
||||||
#include "two.h"
|
#include "two.h"
|
||||||
#include "three.h"
|
#include "three.h"
|
||||||
#include <four.h>
|
#include <four.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
#include "Mockstanky.h"
|
#include "funky.h"
|
||||||
|
#include <setjmp.h>
|
||||||
//=======External Functions This Runner Calls=====
|
#include "Mockstanky.h"
|
||||||
extern void setUp(void);
|
|
||||||
extern void tearDown(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheFirstThingToTest(void);
|
extern void setUp(void);
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
|
extern void test_TheSecondThingToTest(void);
|
||||||
//=======Mock Management=====
|
|
||||||
static void CMock_Init(void)
|
|
||||||
{
|
//=======Mock Management=====
|
||||||
Mockstanky_Init();
|
static void CMock_Init(void)
|
||||||
}
|
{
|
||||||
static void CMock_Verify(void)
|
Mockstanky_Init();
|
||||||
{
|
}
|
||||||
Mockstanky_Verify();
|
static void CMock_Verify(void)
|
||||||
}
|
{
|
||||||
static void CMock_Destroy(void)
|
Mockstanky_Verify();
|
||||||
{
|
}
|
||||||
Mockstanky_Destroy();
|
static void CMock_Destroy(void)
|
||||||
}
|
{
|
||||||
|
Mockstanky_Destroy();
|
||||||
//=======Suite Setup=====
|
}
|
||||||
static int suite_setup(void)
|
|
||||||
{
|
//=======Suite Setup=====
|
||||||
a_yaml_setup();
|
static int suite_setup(void)
|
||||||
}
|
{
|
||||||
|
a_yaml_setup();
|
||||||
//=======Test Reset Option=====
|
}
|
||||||
void resetTest()
|
|
||||||
{
|
//=======Test Reset Option=====
|
||||||
CMock_Verify();
|
void resetTest()
|
||||||
CMock_Destroy();
|
{
|
||||||
tearDown();
|
CMock_Verify();
|
||||||
CMock_Init();
|
CMock_Destroy();
|
||||||
setUp();
|
tearDown();
|
||||||
}
|
CMock_Init();
|
||||||
|
setUp();
|
||||||
|
}
|
||||||
//=======MAIN=====
|
|
||||||
int main(void)
|
|
||||||
{
|
//=======MAIN=====
|
||||||
suite_setup();
|
int main(void)
|
||||||
Unity.TestFile = "test/testdata/mocksample.c";
|
{
|
||||||
UnityBegin();
|
suite_setup();
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
Unity.TestFile = "test/testdata/mocksample.c";
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
UnityBegin();
|
||||||
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
}
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,60 +1,63 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "one.h"
|
#include "one.h"
|
||||||
#include "two.h"
|
#include "two.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
|
#include "funky.h"
|
||||||
int GlobalExpectCount;
|
#include "stanky.h"
|
||||||
int GlobalVerifyOrder;
|
#include <setjmp.h>
|
||||||
char* GlobalOrderError;
|
|
||||||
|
int GlobalExpectCount;
|
||||||
//=======External Functions This Runner Calls=====
|
int GlobalVerifyOrder;
|
||||||
extern void setUp(void);
|
char* GlobalOrderError;
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Test Reset Option=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
void resetTest()
|
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
//=======MAIN=====
|
||||||
UnityBegin();
|
int main(void)
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
{
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,63 +1,66 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "funky.h"
|
||||||
//=======External Functions This Runner Calls=====
|
#include "stanky.h"
|
||||||
extern void setUp(void);
|
#include <setjmp.h>
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Suite Setup=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
static int suite_setup(void)
|
|
||||||
{
|
|
||||||
a_custom_setup();
|
//=======Suite Setup=====
|
||||||
}
|
static int suite_setup(void)
|
||||||
|
{
|
||||||
//=======Suite Teardown=====
|
a_custom_setup();
|
||||||
static int suite_teardown(int num_failures)
|
}
|
||||||
{
|
|
||||||
a_custom_teardown();
|
//=======Suite Teardown=====
|
||||||
}
|
static int suite_teardown(int num_failures)
|
||||||
|
{
|
||||||
//=======Test Reset Option=====
|
a_custom_teardown();
|
||||||
void resetTest()
|
}
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
suite_setup();
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
suite_setup();
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return suite_teardown(UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return suite_teardown(UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,51 +1,54 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST_NO_ARGS
|
#define RUN_TEST_NO_ARGS
|
||||||
#define RUN_TEST(TestFunc, TestLineNum, ...) \
|
#define RUN_TEST(TestFunc, TestLineNum, ...) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \
|
Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(__VA_ARGS__); \
|
TestFunc(__VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "funky.h"
|
||||||
//=======External Functions This Runner Calls=====
|
#include "stanky.h"
|
||||||
extern void setUp(void);
|
#include <setjmp.h>
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Test Reset Option=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
void resetTest()
|
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
//=======MAIN=====
|
||||||
UnityBegin();
|
int main(void)
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS);
|
{
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21, RUN_TEST_NO_ARGS);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43, RUN_TEST_NO_ARGS);
|
||||||
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,60 +1,63 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "one.h"
|
#include "one.h"
|
||||||
#include "two.h"
|
#include "two.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
|
#include "funky.h"
|
||||||
int GlobalExpectCount;
|
#include "stanky.h"
|
||||||
int GlobalVerifyOrder;
|
#include <setjmp.h>
|
||||||
char* GlobalOrderError;
|
|
||||||
|
int GlobalExpectCount;
|
||||||
//=======External Functions This Runner Calls=====
|
int GlobalVerifyOrder;
|
||||||
extern void setUp(void);
|
char* GlobalOrderError;
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Test Reset Option=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
void resetTest()
|
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
//=======MAIN=====
|
||||||
UnityBegin();
|
int main(void)
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
{
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,63 +1,66 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "funky.h"
|
||||||
//=======External Functions This Runner Calls=====
|
#include "stanky.h"
|
||||||
extern void setUp(void);
|
#include <setjmp.h>
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Suite Setup=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
static int suite_setup(void)
|
|
||||||
{
|
|
||||||
a_custom_setup();
|
//=======Suite Setup=====
|
||||||
}
|
static int suite_setup(void)
|
||||||
|
{
|
||||||
//=======Suite Teardown=====
|
a_custom_setup();
|
||||||
static int suite_teardown(int num_failures)
|
}
|
||||||
{
|
|
||||||
a_custom_teardown();
|
//=======Suite Teardown=====
|
||||||
}
|
static int suite_teardown(int num_failures)
|
||||||
|
{
|
||||||
//=======Test Reset Option=====
|
a_custom_teardown();
|
||||||
void resetTest()
|
}
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
suite_setup();
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
suite_setup();
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return suite_teardown(UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return suite_teardown(UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1,64 +1,67 @@
|
|||||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||||
|
|
||||||
//=======Test Runner Used To Run Each Test Below=====
|
//=======Test Runner Used To Run Each Test Below=====
|
||||||
#define RUN_TEST(TestFunc, TestLineNum) \
|
#define RUN_TEST(TestFunc, TestLineNum) \
|
||||||
{ \
|
{ \
|
||||||
Unity.CurrentTestName = #TestFunc; \
|
Unity.CurrentTestName = #TestFunc; \
|
||||||
Unity.CurrentTestLineNumber = TestLineNum; \
|
Unity.CurrentTestLineNumber = TestLineNum; \
|
||||||
Unity.NumberOfTests++; \
|
Unity.NumberOfTests++; \
|
||||||
if (TEST_PROTECT()) \
|
if (TEST_PROTECT()) \
|
||||||
{ \
|
{ \
|
||||||
CEXCEPTION_T e; \
|
CEXCEPTION_T e; \
|
||||||
Try { \
|
Try { \
|
||||||
setUp(); \
|
setUp(); \
|
||||||
TestFunc(); \
|
TestFunc(); \
|
||||||
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
|
||||||
} \
|
} \
|
||||||
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
|
||||||
{ \
|
{ \
|
||||||
tearDown(); \
|
tearDown(); \
|
||||||
} \
|
} \
|
||||||
UnityConcludeTest(); \
|
UnityConcludeTest(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======Automagically Detected Files To Include=====
|
//=======Automagically Detected Files To Include=====
|
||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "two.h"
|
#include "two.h"
|
||||||
#include "three.h"
|
#include "three.h"
|
||||||
#include <four.h>
|
#include <four.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "CException.h"
|
#include "CException.h"
|
||||||
|
#include "funky.h"
|
||||||
//=======External Functions This Runner Calls=====
|
#include "stanky.h"
|
||||||
extern void setUp(void);
|
#include <setjmp.h>
|
||||||
extern void tearDown(void);
|
|
||||||
extern void test_TheFirstThingToTest(void);
|
//=======External Functions This Runner Calls=====
|
||||||
extern void test_TheSecondThingToTest(void);
|
extern void setUp(void);
|
||||||
|
extern void tearDown(void);
|
||||||
|
extern void test_TheFirstThingToTest(void);
|
||||||
//=======Suite Setup=====
|
extern void test_TheSecondThingToTest(void);
|
||||||
static int suite_setup(void)
|
|
||||||
{
|
|
||||||
a_yaml_setup();
|
//=======Suite Setup=====
|
||||||
}
|
static int suite_setup(void)
|
||||||
|
{
|
||||||
//=======Test Reset Option=====
|
a_yaml_setup();
|
||||||
void resetTest()
|
}
|
||||||
{
|
|
||||||
tearDown();
|
//=======Test Reset Option=====
|
||||||
setUp();
|
void resetTest()
|
||||||
}
|
{
|
||||||
|
tearDown();
|
||||||
|
setUp();
|
||||||
//=======MAIN=====
|
}
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
suite_setup();
|
//=======MAIN=====
|
||||||
Unity.TestFile = "test/testdata/testsample.c";
|
int main(void)
|
||||||
UnityBegin();
|
{
|
||||||
RUN_TEST(test_TheFirstThingToTest, 21);
|
suite_setup();
|
||||||
RUN_TEST(test_TheSecondThingToTest, 43);
|
Unity.TestFile = "test/testdata/testsample.c";
|
||||||
|
UnityBegin();
|
||||||
return (UnityEnd());
|
RUN_TEST(test_TheFirstThingToTest, 21);
|
||||||
}
|
RUN_TEST(test_TheSecondThingToTest, 43);
|
||||||
|
|
||||||
|
return (UnityEnd());
|
||||||
|
}
|
||||||
|
@ -1622,10 +1622,10 @@ void testNotEqualUINT32Arrays3(void)
|
|||||||
|
|
||||||
void testEqualHEXArrays(void)
|
void testEqualHEXArrays(void)
|
||||||
{
|
{
|
||||||
unsigned int p0[] = {1, 8, 987, 65132u};
|
_UU32 p0[] = {1, 8, 987, 65132u};
|
||||||
unsigned int p1[] = {1, 8, 987, 65132u};
|
_UU32 p1[] = {1, 8, 987, 65132u};
|
||||||
unsigned int p2[] = {1, 8, 987, 2};
|
_UU32 p2[] = {1, 8, 987, 2};
|
||||||
unsigned int p3[] = {1, 500, 600, 700};
|
_UU32 p3[] = {1, 500, 600, 700};
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 1);
|
TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 1);
|
||||||
TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 4);
|
TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p0, 4);
|
||||||
@ -1636,8 +1636,8 @@ void testEqualHEXArrays(void)
|
|||||||
|
|
||||||
void testNotEqualHEXArrays1(void)
|
void testNotEqualHEXArrays1(void)
|
||||||
{
|
{
|
||||||
unsigned int p0[] = {1, 8, 987, 65132u};
|
_UU32 p0[] = {1, 8, 987, 65132u};
|
||||||
unsigned int p1[] = {1, 8, 987, 65131u};
|
_UU32 p1[] = {1, 8, 987, 65131u};
|
||||||
|
|
||||||
EXPECT_ABORT_BEGIN
|
EXPECT_ABORT_BEGIN
|
||||||
TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4);
|
TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4);
|
||||||
@ -1646,8 +1646,8 @@ void testNotEqualHEXArrays1(void)
|
|||||||
|
|
||||||
void testNotEqualHEXArrays2(void)
|
void testNotEqualHEXArrays2(void)
|
||||||
{
|
{
|
||||||
unsigned int p0[] = {1, 8, 987, 65132u};
|
_UU32 p0[] = {1, 8, 987, 65132u};
|
||||||
unsigned int p1[] = {2, 8, 987, 65132u};
|
_UU32 p1[] = {2, 8, 987, 65132u};
|
||||||
|
|
||||||
EXPECT_ABORT_BEGIN
|
EXPECT_ABORT_BEGIN
|
||||||
TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4);
|
TEST_ASSERT_EQUAL_HEX32_ARRAY(p0, p1, 4);
|
||||||
@ -1656,8 +1656,8 @@ void testNotEqualHEXArrays2(void)
|
|||||||
|
|
||||||
void testNotEqualHEXArrays3(void)
|
void testNotEqualHEXArrays3(void)
|
||||||
{
|
{
|
||||||
unsigned int p0[] = {1, 8, 987, 65132u};
|
_UU32 p0[] = {1, 8, 987, 65132u};
|
||||||
unsigned int p1[] = {1, 8, 986, 65132u};
|
_UU32 p1[] = {1, 8, 986, 65132u};
|
||||||
|
|
||||||
EXPECT_ABORT_BEGIN
|
EXPECT_ABORT_BEGIN
|
||||||
TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p1, 4);
|
TEST_ASSERT_EQUAL_HEX_ARRAY(p0, p1, 4);
|
||||||
@ -2964,4 +2964,4 @@ void testNotEqualDoubleArraysInf(void)
|
|||||||
TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4);
|
TEST_ASSERT_EQUAL_DOUBLE_ARRAY(p0, p1, 4);
|
||||||
VERIFY_FAILS_END
|
VERIFY_FAILS_END
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user