- 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:
Rongsong Shen 2026-01-30 12:26:23 +08:00
parent c8c1749347
commit f78ed03591
15 changed files with 252 additions and 114 deletions

View 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);
}