1 #pragma once
2 
3 #include <common/printk.h>
4 #include <common/compiler.h>
5 
6 #define assert(condition) ({                                                                       \
7     int __condition = !!(condition);                                                               \
8     if (unlikely(!(__condition)))                                                                  \
9     {                                                                                              \
10         printk("[ kTEST FAILED ] Ktest Assertion Failed, file:%s, Line:%d\n", __FILE__, __LINE__); \
11     }                                                                                              \
12     likely(__condition);                                                                           \
13 })
14 
15 #define kTEST(...)                                                  \
16     do                                                              \
17     {                                                               \
18         printk("[ kTEST ] file:%s, Line:%d\t", __FILE__, __LINE__); \
19         printk(__VA_ARGS__);                                        \
20         printk("\n");                                               \
21     } while (0)
22 
23 /**
24  * @brief 测试用例函数表
25  *
26  */
27 typedef long (*ktest_case_table)(uint64_t arg0, uint64_t arg1);