I am trying to run Google test with the below code. I am reading some memory location for register value with code similar to the examples below.
Header file :
typedef union MYREG
{
uint32_t u32reg;
uint8_t au8byte[4];
} MYREG_t;
#define SET_VALUE (0x00000002)
#define TEST_REGISTER ((volatile MYREG_t*)0x2025111BUL)
In code I am reading and writing values as
void testcode()
{
TEST_REGISTER->u32reg |= SET_VALUE;
call_another_funct();
}
When i try to run google test by writing a test case for this function
TEST_F(sample_test, check)
{
testcode();
}
I am getting below SEH error
First-chance exception at 0x0036B28F in test.exe: 0xC0000005: Access violation reading location 0x2025111B.
Unknown file: error: SEH exception with code 0xC0000005 thrown in the test body.
What is going wrong here ? Any suggestion would helpful for me to understand the error.