diff --git a/auto/colour_prompt.rb b/auto/colour_prompt.rb index 71fefba581d676a8d08b9b828a2fa9387f08900a..81003dd59d64a8cac094833db96ea17703d272ae 100644 --- a/auto/colour_prompt.rb +++ b/auto/colour_prompt.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + if RUBY_PLATFORM =~/(win|w)32$/ begin require 'Win32API' diff --git a/auto/colour_reporter.rb b/auto/colour_reporter.rb index 42a0526e92ff832e65d8f934ee1a82764b69f354..89e79519c24dec1b39a0b6e67a66c1083de05c87 100644 --- a/auto/colour_reporter.rb +++ b/auto/colour_reporter.rb @@ -1,3 +1,8 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt" diff --git a/auto/generate_module.rb b/auto/generate_module.rb index bd8dbe2338be62662e83554a7e0bdfba99914882..17036ddcf8d14d08be7bdc985bd8bb0b43fc8cd4 100644 --- a/auto/generate_module.rb +++ b/auto/generate_module.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + # This script creates all the files with start code necessary for a new module. # A simple module only requires a source file, header file, and test file. # Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware). diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 0655a3de50909d61a7faeff7303ae82ffe0a6d72..d3bbf1f176d95e9e87cf3fc70ae46b9c27fbf61e 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + File.expand_path(File.join(File.dirname(__FILE__),'colour_prompt')) class UnityTestRunnerGenerator @@ -187,10 +193,10 @@ class UnityTestRunnerGenerator output.puts(" setUp();") output.puts(" test();") output.puts(" CMock_Verify();") unless (used_mocks.empty?) - output.puts(" } Catch(e) { TEST_FAIL(\"Unhandled Exception!\"); }") if @options[:cexception] + output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); }") if @options[:cexception] output.puts(" }") output.puts(" CMock_Destroy();") unless (used_mocks.empty?) - output.puts(" if (TEST_PROTECT())") + output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED)") output.puts(" {") output.puts(" tearDown();") output.puts(" }") diff --git a/auto/test_file_filter.rb b/auto/test_file_filter.rb index 60abc2016aae7acfa2c5e03e7c3aa8dffa29eaf7..3dbc26a28e066a9a1f01cff00c60d5cabd8bf813 100644 --- a/auto/test_file_filter.rb +++ b/auto/test_file_filter.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require'yaml' module RakefileHelpers diff --git a/auto/unity_test_summary.rb b/auto/unity_test_summary.rb index 929018ef0f158eed719ee4c9120a637d5e1e9f8c..f8035f4e03b66d1103adbe5caa21b61658102db1 100644 --- a/auto/unity_test_summary.rb +++ b/auto/unity_test_summary.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + #!/usr/bin/ruby # # unity_test_summary.rb diff --git a/docs/Unity Summary.odt b/docs/Unity Summary.odt index 7d992514caf6006243c58a7e5a3f1690179dc091..18aa98a379bdbad6510a34134421ef171bd2d9bf 100644 Binary files a/docs/Unity Summary.odt and b/docs/Unity Summary.odt differ diff --git a/docs/Unity Summary.pdf b/docs/Unity Summary.pdf index fcf53d6b360ab2b1844b56437b79618c05dc8b51..9cf758d5b11a198b07608965461c290aff08157c 100644 Binary files a/docs/Unity Summary.pdf and b/docs/Unity Summary.pdf differ diff --git a/docs/Unity Summary.txt b/docs/Unity Summary.txt index a77c7735f8f548875d34a3067fd5206d85eff424..bf9c80377bb581329fa0769baae0649d63677205 100644 --- a/docs/Unity Summary.txt +++ b/docs/Unity Summary.txt @@ -2,6 +2,8 @@ Unity Test API ============== +[Copyright (c) 2007 - Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams] + ------------- Running Tests ------------- diff --git a/examples/helper/UnityHelper.c b/examples/helper/UnityHelper.c index db4d310740ee7948b2785c00eb4019823aa454b0..b06af3bb8fa0048115f9b0d87cf6f25069eba2f3 100644 --- a/examples/helper/UnityHelper.c +++ b/examples/helper/UnityHelper.c @@ -3,19 +3,6 @@ #include #include -static char message[1024]; - -void AssertFloatArrayWithin(const float tolerance, const float* expected, const float* actual, const unsigned int length, const unsigned short line) -{ - unsigned int i; - - for (i = 0; i < length; i++) - { - sprintf(message, "Array mismatch at index %u, Expected %f, Actual %f, Tolerance %f, Delta %f", i, expected[i], actual[i], tolerance, (expected[i]-actual[i])); - UNITY_TEST_ASSERT_WITHIN_FLOAT(tolerance, expected[i], actual[i], line, message); - } -} - void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line) { UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Example Struct Failed For Field x"); diff --git a/examples/helper/UnityHelper.h b/examples/helper/UnityHelper.h index 1fb3a0e18f9bbb24b8ffe0ed7419532b20a2ba07..538caaeeaa6f7cd9f0af32ef4da2bb2dae8d37d9 100644 --- a/examples/helper/UnityHelper.h +++ b/examples/helper/UnityHelper.h @@ -3,13 +3,10 @@ #include "Types.h" -void AssertFloatArrayWithin(const float tolerance, const float* expected, const float* actual, const unsigned int length, const unsigned short line); void AssertEqualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line); -#define UNITY_TEST_ASSERT_FLOAT_ARRAY_WITHIN(tolerance, expected, actual, length, line, message) AssertFloatArrayWithin(tolerance, expected, actual, length, line); #define UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, line, message) AssertEqualExampleStruct(expected, actual, line); -#define TEST_ASSERT_FLOAT_ARRAY_WITHIN(tolerance, expected, actual, length) UNITY_TEST_ASSERT_FLOAT_ARRAY_WITHIN(tolerance, expected, actual, __LINE__, NULL); #define TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual) UNITY_TEST_ASSERT_EQUAL_EXAMPLE_STRUCT_T(expected, actual, __LINE__, NULL); #endif // _TESTHELPER_H diff --git a/examples/iar_v4.yml b/examples/iar_v4.yml index b6a222b858f6ac310d01baeb6948c77d096fbefa..2b28bd088db2f91e87272103a440f8b69bfbb72d 100644 --- a/examples/iar_v4.yml +++ b/examples/iar_v4.yml @@ -31,8 +31,8 @@ compiler: items: - [*tools_root, 'arm\inc\'] - 'src\' + - '../src/' - *unit_tests_path - - 'vendor\unity\src\' defines: prefix: '-D' items: diff --git a/examples/iar_v5.yml b/examples/iar_v5.yml index 8173acd553ec8ef80980ed75dabff9309f40939f..b7cd3ff941d500e76a7a97b5a688bb1b11134ff5 100644 --- a/examples/iar_v5.yml +++ b/examples/iar_v5.yml @@ -30,9 +30,8 @@ compiler: items: - [*tools_root, 'arm\inc\'] - 'src\' + - '../src/' - *unit_tests_path - - 'vendor\unity\src\' - - 'iar\iar_v5\incIAR\' defines: prefix: '-D' items: diff --git a/examples/makefile b/examples/makefile new file mode 100644 index 0000000000000000000000000000000000000000..3d4ac1fffbef339d9f6909c901e87366cda0161c --- /dev/null +++ b/examples/makefile @@ -0,0 +1,40 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + +C_COMPILER=gcc +TARGET_BASE1=test1 +TARGET_BASE2=test2 +ifeq ($(OS),Windows_NT) + TARGET_EXTENSION=.exe +else + TARGET_EXTENSION=.out +endif +TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) +TARGET2 = $(TARGET_BASE2)$(TARGET_EXTENSION) +SRC_FILES1=../src/unity.c src/ProductionCode.c test/TestProductionCode.c test/no_ruby/TestProductionCode_Runner.c +SRC_FILES2=../src/unity.c src/ProductionCode2.c test/TestProductionCode2.c test/no_ruby/TestProductionCode2_Runner.c +INC_DIRS=-Isrc -I../src +SYMBOLS=-DTEST + +ifeq ($(OS),Windows_NT) + CLEANUP = del /F /Q build\* && del /F /Q $(TARGET1) && del /F /Q $(TARGET2) +else + CLEANUP = rm -f build/*.o ; rm -f $(TARGET1) ; rm -f $(TARGET2) +endif + +all: clean default + +default: +# ruby auto/generate_test_runner.rb test/TestProductionCode.c test/no_ruby/TestProductionCode_Runner.c +# ruby auto/generate_test_runner.rb test/TestProductionCode2.c test/no_ruby/TestProductionCode2_Runner.c + $(C_COMPILER) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) + $(C_COMPILER) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES2) -o $(TARGET2) + $(TARGET1) + $(TARGET2) + +clean: + $(CLEANUP) + diff --git a/examples/readme.txt b/examples/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..f87005764910eaea56d25bcfaea6228c7f6dffc7 --- /dev/null +++ b/examples/readme.txt @@ -0,0 +1,18 @@ +Example Project + +This example project gives an example of some passing, ignored, and failing tests. +It's simple and meant for you to look over and get an idea for what all of this stuff does. + +You can build and test using the makefile if you have gcc installed (you may need to tweak +the locations of some tools in the makefile). Otherwise, the rake version will let you +test with gcc or a couple versions of IAR. You can tweak the yaml files to get those versions +running. + +Ruby is required if you're using the rake version (obviously). This version shows off most of +Unity's advanced features (automatically creating test runners, fancy summaries, etc.) + +The makefile version doesn't require anything outside of your normal build tools, but won't do the +extras for you. So that you can test right away, we've written the test runners for you and +put them in the test\no_ruby subdirectory. If you make changes to the tests or source, you might +need to update these (like when you add or remove tests). Do that for a while and you'll learn +why you really want to start using the Ruby tools. \ No newline at end of file diff --git a/examples/src/ProductionCode2.c b/examples/src/ProductionCode2.c index 543f4e41f320dd1b7a678555ad9eb132483ee956..0cca0d5f4a551eddfeb9e18990e4a3abcb85bce2 100644 --- a/examples/src/ProductionCode2.c +++ b/examples/src/ProductionCode2.c @@ -5,4 +5,5 @@ char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) { //Since There Are No Tests Yet, This Function Could Be Empty For All We Know. // Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget + return (char*)0; } diff --git a/examples/test/no_ruby/TestProductionCode2_Runner.c b/examples/test/no_ruby/TestProductionCode2_Runner.c new file mode 100644 index 0000000000000000000000000000000000000000..9862a1dfb140d67053db788da52fa43abf8140ee --- /dev/null +++ b/examples/test/no_ruby/TestProductionCode2_Runner.c @@ -0,0 +1,46 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ +#include "unity.h" +#include +#include + +char MessageBuffer[50]; + +extern void setUp(void); +extern void tearDown(void); + +extern void test_IgnoredTest(void); +extern void test_AnotherIgnoredTest(void); +extern void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void); + +static void runTest(UnityTestFunction test) +{ + if (TEST_PROTECT()) + { + setUp(); + test(); + } + if (TEST_PROTECT() && !TEST_IS_IGNORED) + { + tearDown(); + } +} +void resetTest() +{ + tearDown(); + setUp(); +} + + +int main(void) +{ + Unity.TestFile = "test/TestProductionCode2.c"; + UnityBegin(); + + // RUN_TEST calls runTest + RUN_TEST(test_IgnoredTest, 13); + RUN_TEST(test_AnotherIgnoredTest, 18); + RUN_TEST(test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented, 23); + + UnityEnd(); + return 0; +} diff --git a/examples/test/no_ruby/TestProductionCode_Runner.c b/examples/test/no_ruby/TestProductionCode_Runner.c new file mode 100644 index 0000000000000000000000000000000000000000..e32d35f6ada3248994683742d0485796ba93d168 --- /dev/null +++ b/examples/test/no_ruby/TestProductionCode_Runner.c @@ -0,0 +1,50 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ +#include "unity.h" +#include +#include + +char MessageBuffer[50]; + +extern void setUp(void); +extern void tearDown(void); + +extern void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void); +extern void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void); +extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void); +extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void); +extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void); + +static void runTest(UnityTestFunction test) +{ + if (TEST_PROTECT()) + { + setUp(); + test(); + } + if (TEST_PROTECT() && !TEST_IS_IGNORED) + { + tearDown(); + } +} +void resetTest() +{ + tearDown(); + setUp(); +} + + +int main(void) +{ + Unity.TestFile = "test/TestProductionCode.c"; + UnityBegin(); + + // RUN_TEST calls runTest + RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode, 20); + RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken, 30); + RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue, 41); + RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain, 51); + RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed, 57); + + UnityEnd(); + return 0; +} diff --git a/makefile b/makefile index 47ae2d59efa450be139ced923338c268d038e671..20d4c3674480be824e6799ec466ebde39eef6de7 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + C_COMPILER=gcc TARGET_BASE = testunity ifeq ($(OS),Windows_NT) @@ -7,7 +13,7 @@ else endif TARGET = $(TARGET_BASE)$(TARGET_EXTENSION) OUT_FILE=-o $(TARGET) -SRC_FILES=src/unity.c test/testunity.c test/testunity_Runner.c +SRC_FILES=src/unity.c test/testunity.c build/testunity_Runner.c INC_DIRS=-Isrc SYMBOLS=-DTEST @@ -20,7 +26,8 @@ endif all: clean default default: - $(C_COMPILER) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES) $(OUT_FILE)$(OUT_EXTENSION) + ruby auto/generate_test_runner.rb test/testunity.c build/testunity_Runner.c + $(C_COMPILER) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES) $(OUT_FILE) $(TARGET) clean: diff --git a/rakefile.rb b/rakefile.rb index cf8f610b48d0a5468c32341399c5dc713b8c124d..5b9652515fec8dd9bab5d7ee1b8a28b1511046b9 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + HERE = File.expand_path(File.dirname(__FILE__)) + '/' #require HERE + 'config/environment' diff --git a/rakefile_helper.rb b/rakefile_helper.rb index 1147de5796e68c76ec46736b7d97595a09d63ba9..9b856b630f96f9ff79ca5e9d2bb0f59b843cccef 100644 --- a/rakefile_helper.rb +++ b/rakefile_helper.rb @@ -1,3 +1,9 @@ +# ========================================== +# Unity Project - A Test Framework for C +# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams +# [Released under MIT License. Please refer to license.txt for details] +# ========================================== + require 'yaml' require 'fileutils' require 'auto/unity_test_summary' diff --git a/src/unity.c b/src/unity.c index a8c854500e0a89fe8d1b6d2b7948ae14ebb57649..c2b182b3f439f03655626c7a8ec313d9fe80b74b 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1,3 +1,9 @@ +/* ========================================== + Unity Project - A Test Framework for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #include "unity.h" #include #include @@ -459,6 +465,7 @@ void UnityAssertEqualString(const char* expected, if (expected[i] != actual[i]) { Unity.CurrentTestFailed = 1; + break; } } } diff --git a/src/unity.h b/src/unity.h index db007713db65c758c32b2b127c9d9991a5455d52..5fb411b5ee59e95cdbc8fbc146cdef30c5e7b390 100644 --- a/src/unity.h +++ b/src/unity.h @@ -1,3 +1,9 @@ +/* ========================================== + Unity Project - A Test Framework for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #ifndef UNITY_FRAMEWORK_H #define UNITY_FRAMEWORK_H @@ -41,6 +47,7 @@ UnityConcludeTest(); #define TEST_LINE_NUM (Unity.CurrentTestLineNumber) +#define TEST_IS_IGNORED (Unity.CurrentTestIgnored) //------------------------------------------------------- // Basic Fail and Ignore diff --git a/src/unity_internals.h b/src/unity_internals.h index 3d533a42fdb9dafc4704a7ac422df8884713149e..305b24401f43055554c0cf18b08526f27a0c9ef6 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -1,3 +1,9 @@ +/* ========================================== + Unity Project - A Test Framework for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ + #ifndef UNITY_INTERNALS_H #define UNITY_INTERNALS_H @@ -70,6 +76,10 @@ typedef UNITY_FLOAT_TYPE _UF; #define UNITY_LINE_TYPE unsigned short #endif +#ifndef UNITY_COUNTER_TYPE +#define UNITY_COUNTER_TYPE unsigned short +#endif + //------------------------------------------------------- // Internal Structs Needed //------------------------------------------------------- @@ -90,11 +100,11 @@ struct _Unity const char* TestFile; const char* CurrentTestName; _UU32 CurrentTestLineNumber; - unsigned char NumberOfTests; - unsigned char TestFailures; - unsigned char TestIgnores; - unsigned char CurrentTestFailed; - unsigned char CurrentTestIgnored; + UNITY_COUNTER_TYPE NumberOfTests; + UNITY_COUNTER_TYPE TestFailures; + UNITY_COUNTER_TYPE TestIgnores; + UNITY_COUNTER_TYPE CurrentTestFailed; + UNITY_COUNTER_TYPE CurrentTestIgnored; jmp_buf AbortFrame; }; diff --git a/test/testunity.c b/test/testunity.c index d34034641b5326c1d961f1c67aeeb970db743e5e..bc8d206e4afa7d42d7e7a7a6b7b02750bc42a78d 100644 --- a/test/testunity.c +++ b/test/testunity.c @@ -1,4 +1,8 @@ -#define UNITY_ENABLE_EXTERNAL_ASSERTIONS +/* ========================================== + Unity Project - A Test Framework for C + Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + [Released under MIT License. Please refer to license.txt for details] +========================================== */ #include #include "unity.h" @@ -17,12 +21,17 @@ TEST_ASSERT_MESSAGE((1u == failed), "<---- [ This Test Should Have Failed But Did Not ]"); \ EXPECT_ABORT_END +int SetToOneToFailInTearDown; + void setUp(void) { + SetToOneToFailInTearDown = 0; } void tearDown(void) { + if (SetToOneToFailInTearDown == 1) + TEST_FAIL("Failed in tearDown"); } void testTrue(void) @@ -429,6 +438,25 @@ void testEqualHex8s(void) TEST_ASSERT_EQUAL_HEX8(*p0, 0x22); } +void testEqualHex8sNegatives(void) +{ + _UU8 v0, v1; + _UU8 *p0, *p1; + + v0 = 0xDD; + v1 = 0xDD; + p0 = &v0; + p1 = &v1; + + TEST_ASSERT_EQUAL_HEX8(0xDD, 0xDD); + TEST_ASSERT_EQUAL_HEX8(v0, v1); + TEST_ASSERT_EQUAL_HEX8(0xDD, v1); + TEST_ASSERT_EQUAL_HEX8(v0, 0xDD); + TEST_ASSERT_EQUAL_HEX8(*p0, v1); + TEST_ASSERT_EQUAL_HEX8(*p0, *p1); + TEST_ASSERT_EQUAL_HEX8(*p0, 0xDD); +} + void testEqualHex16s(void) { _UU16 v0, v1; @@ -689,7 +717,7 @@ void testUIntsNotWithinDelta(void) int failed; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_WITHIN(1, 2147483647, 2147483649); + TEST_ASSERT_UINT_WITHIN(1, 2147483647u, 2147483649u); EXPECT_ABORT_END failed = Unity.CurrentTestFailed; @@ -738,7 +766,7 @@ void testHEX32sNotWithinDelta(void) int failed; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_WITHIN(1, 2147483647, 2147483649); + TEST_ASSERT_HEX32_WITHIN(1, 2147483647u, 2147483649u); EXPECT_ABORT_END failed = Unity.CurrentTestFailed; @@ -1477,3 +1505,8 @@ void testProtection(void) TEST_ASSERT_EQUAL(3, mask); } +void testIgnoredAndThenFailInTearDown(void) +{ + SetToOneToFailInTearDown = 1; + TEST_IGNORE(); +}