mirror of
https://github.com/throwtheswitch/cexception.git
synced 2026-08-30 14:59:57 +00:00
* fixed error where fallback function was showing wrong ID
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "unity.h"
|
||||
|
||||
extern volatile int TestingTheFallback;
|
||||
extern volatile int TestingTheFallbackId;
|
||||
|
||||
//Optionally define the exception type (something like an int which can be directly assigned)
|
||||
#define CEXCEPTION_T int
|
||||
@@ -20,6 +21,7 @@ extern volatile int TestingTheFallback;
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
TestingTheFallbackId = id; \
|
||||
TestingTheFallback--; \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "CException.h"
|
||||
|
||||
volatile int TestingTheFallback;
|
||||
volatile int TestingTheFallbackId;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
@@ -314,6 +315,7 @@ void test_AThrowWithoutATryCatchWillUseDefaultHandlerIfSpecified(void)
|
||||
|
||||
//We know the fallback was run because it decrements the counter above
|
||||
TEST_ASSERT_FALSE(TestingTheFallback);
|
||||
TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId);
|
||||
}
|
||||
|
||||
void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(void)
|
||||
@@ -336,4 +338,5 @@ void test_AThrowWithoutOutsideATryCatchWillUseDefaultHandlerEvenAfterTryCatch(vo
|
||||
|
||||
//We know the fallback was run because it decrements the counter above
|
||||
TEST_ASSERT_FALSE(TestingTheFallback);
|
||||
}
|
||||
TEST_ASSERT_EQUAL(0xBE, TestingTheFallbackId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user