test/unit_test.c
bool IS_ASSERT(void)
{
    if ((ut_assert.enable == 1) && (ut_assert.state == 1))
    {
        ut_assert.state = 0;

#ifdef UNIT_TEST_DEBUG
        uint32_t line = (ut_assert.msg.data[0]);
        if (ut_assert.line_size > 3)
        {
            line += (ut_assert.msg.data[2] << 4) + (ut_assert.msg.data[1] << 8) + (ut_assert.msg.data[3] << 12);
        }
        else if (ut_assert.line_size > 2)
        {
            line += (ut_assert.msg.data[2] << 4) + (ut_assert.msg.data[1] << 8);
        }
        else if (ut_assert.line_size > 1)
        {
            line += (ut_assert.msg.data[2] << 4);
        }

        printf("\n*\t[INFO] Assert message received\t");
        printf("- Line : ");
        printf("%d - ", line);
        printf("\t- File : ");
        for (uint32_t i = 0; i < ut_assert.file_size; i++)
        {
            printf("%c", ut_assert.msg.data[i + ut_assert.line_size]);
        }
        printf("\n");
#endif

        return true;
    }
    else
    {
        ut_assert.state = 0;
        return false;
    }
}
/******************************************************************************
 * @brief Check if an assert has occured
 * @param None
 * @return True boolean if an assert has occured
 ******************************************************************************/
@brief Check if an assert has occured
@param None
@return True boolean if an assert has occured
@brief Check if an assert has occured @param None @return True boolean if an assert has occured
bool IS_ASSERT(void)
{
    if ((ut_assert.enable == 1) && (ut_assert.state == 1))
    {
        ut_assert.state = 0;
#ifdef UNIT_TEST_DEBUG
        uint32_t line = (ut_assert.msg.data[0]);
        if (ut_assert.line_size > 3)
        {
            line += (ut_assert.msg.data[2] << 4) + (ut_assert.msg.data[1] << 8) + (ut_assert.msg.data[3] << 12);
        }
        else if (ut_assert.line_size > 2)
        {
            line += (ut_assert.msg.data[2] << 4) + (ut_assert.msg.data[1] << 8);
        }
        else if (ut_assert.line_size > 1)
        {
            line += (ut_assert.msg.data[2] << 4);
        }
        printf("\n*\t[INFO] Assert message received\t");
        printf("- Line : ");
        printf("%d - ", line);
        printf("\t- File : ");
        for (uint32_t i = 0; i < ut_assert.file_size; i++)
        {
            printf("%c", ut_assert.msg.data[i + ut_assert.line_size]);
        }
        printf("\n");
#endif
        return true;
    }
    else
    {
        ut_assert.state = 0;
        return false;
    }
}
bool IS_ASSERT ( void ) { if ( ( ut_assert . enable == 1 ) && ( ut_assert . state == 1 ) ) { ut_assert . state = 0 ; #ifdef UNIT_TEST_DEBUG uint32_t line = ( ut_assert . msg . data [ 0 ] ) ; if ( ut_assert . line_size > 3 ) { line += ( ut_assert . msg . data [ 2 ] << 4 ) + ( ut_assert . msg . data [ 1 ] << 8 ) + ( ut_assert . msg . data [ 3 ] << 12 ) ; } else if ( ut_assert . line_size > 2 ) { line += ( ut_assert . msg . data [ 2 ] << 4 ) + ( ut_assert . msg . data [ 1 ] << 8 ) ; } else if ( ut_assert . line_size > 1 ) { line += ( ut_assert . msg . data [ 2 ] << 4 ) ; } printf ( " \n \t \t " ) ; printf ( " " ) ; printf ( " " , line ) ; printf ( " \t " ) ; for ( uint32_t i = 0 ; i < ut_assert . file_size ; i ++ ) { printf ( " " , ut_assert . msg . data [ i + ut_assert . line_size ] ) ; } printf ( " \n " ) ; #endif return true ; } else { ut_assert . state = 0 ; return false ; } }
@brief Check if an assert has occured
 @param None
 @return True boolean if an assert has occured
@brief Check if an assert has occured @param None @return True boolean if an assert has occured