- improve the interface of rtti to pass meta_obj_t* as parameter of type function to easy to access private/data
- rename some macro with RTTI - add RTTI_MAGIC in object header - add new rtti api
This commit is contained in:
parent
c8c1749347
commit
f78ed03591
15 changed files with 252 additions and 114 deletions
26
testsuite/test_invalid_obj.c
Normal file
26
testsuite/test_invalid_obj.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <unity/unity.h>
|
||||
|
||||
#include "rtti.h"
|
||||
|
||||
static void test_c_str_invalid(void)
|
||||
{
|
||||
char* hello = "Hello, world";
|
||||
|
||||
TEST_ASSERT_TRUE(is_rtti_obj(hello) == 0);
|
||||
}
|
||||
|
||||
static void test_intptr_invalid(void) {
|
||||
int x = 20;
|
||||
|
||||
TEST_ASSERT_TRUE(is_rtti_obj(&x) == 0);
|
||||
}
|
||||
|
||||
void test_invalid(void)
|
||||
{
|
||||
printf("\n invalid object\n\n");
|
||||
|
||||
RUN_TEST(test_c_str_invalid);
|
||||
RUN_TEST(test_intptr_invalid);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue