* fixed error where fallback function was showing wrong ID

This commit is contained in:
Mark VanderVoord
2013-09-19 10:56:30 -04:00
parent dd9dcde2f0
commit f64bdb2ea1
3 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ void Throw(CEXCEPTION_T ExceptionID)
{ {
longjmp(*CExceptionFrames[MY_ID].pFrame, 1); longjmp(*CExceptionFrames[MY_ID].pFrame, 1);
} }
CEXCEPTION_NO_CATCH_HANDLER(MY_ID); CEXCEPTION_NO_CATCH_HANDLER(ExceptionID);
} }
//------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------
+2
View File
@@ -4,6 +4,7 @@
#include "unity.h" #include "unity.h"
extern volatile int TestingTheFallback; extern volatile int TestingTheFallback;
extern volatile int TestingTheFallbackId;
//Optionally define the exception type (something like an int which can be directly assigned) //Optionally define the exception type (something like an int which can be directly assigned)
#define CEXCEPTION_T int #define CEXCEPTION_T int
@@ -20,6 +21,7 @@ extern volatile int TestingTheFallback;
} \ } \
else \ else \
{ \ { \
TestingTheFallbackId = id; \
TestingTheFallback--; \ TestingTheFallback--; \
} \ } \
} }
+3
View File
@@ -2,6 +2,7 @@
#include "CException.h" #include "CException.h"
volatile int TestingTheFallback; volatile int TestingTheFallback;
volatile int TestingTheFallbackId;
void setUp(void) void setUp(void)
{ {
@@ -314,6 +315,7 @@ void test_AThrowWithoutATryCatchWillUseDefaultHandlerIfSpecified(void)
//We know the fallback was run because it decrements the counter above //We know the fallback was run because it decrements the counter above
TEST_ASSERT_FALSE(TestingTheFallback); TEST_ASSERT_FALSE(TestingTheFallback);
TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId);
} }
void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(void) void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(void)
@@ -336,4 +338,5 @@ void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(vo
//We know the fallback was run because it decrements the counter above //We know the fallback was run because it decrements the counter above
TEST_ASSERT_FALSE(TestingTheFallback); TEST_ASSERT_FALSE(TestingTheFallback);
TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId);
} }