mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-13 12:29:41 -07:00
string list sub range helper
This commit is contained in:
1 parent
d7cfd5f55a
commit
acce76aa4c
5 files changed
+126
-15
No files matched your search
+15
-15
@@ -39,10 +39,10 @@ typedef struct
|
||||
extern U64 g_torture_test_count;
|
||||
extern T_Test g_torture_tests[0xffffff];
|
||||
|
||||
#define T_AddTest(name, l, ...) \
|
||||
T_RunResult t_##name(void); \
|
||||
__VA_ARGS__ void t_add_test_##name(void) \
|
||||
{ \
|
||||
#define T_AddTest(name, l, ...) \
|
||||
T_RunResult t_##name(void); \
|
||||
__VA_ARGS__ void t_add_test_##name(void) \
|
||||
{ \
|
||||
g_torture_tests[g_torture_test_count].group = T_Group; \
|
||||
g_torture_tests[g_torture_test_count].label = Stringify(name); \
|
||||
g_torture_tests[g_torture_test_count].r = &t_##name; \
|
||||
@@ -52,7 +52,7 @@ g_torture_test_count += 1; \
|
||||
|
||||
#if COMPILER_MSVC
|
||||
#pragma section(".CRT$XCU", read)
|
||||
# define T_BeginTest_(name) \
|
||||
# define T_BeginTest_(name) \
|
||||
T_AddTest(name, __LINE__) \
|
||||
__declspec(allocate(".CRT$XCU")) void(*r_##name)(void) = t_add_test_##name; \
|
||||
__pragma(comment(linker, "/include:" Stringify(r_##name)))
|
||||
@@ -61,20 +61,20 @@ __pragma(comment(linker, "/include:" Stringify(r_##name)))
|
||||
T_AddTest(name, __LINE__, __attribute__((constructor)))
|
||||
#endif
|
||||
|
||||
#define T_BeginTest(name) \
|
||||
T_BeginTest_(name) \
|
||||
T_RunResult t_##name(void) { \
|
||||
#define T_BeginTest(name) \
|
||||
T_BeginTest_(name) \
|
||||
T_RunResult t_##name(void) { \
|
||||
Temp scratch = scratch_begin(0,0); \
|
||||
T_RunResult result = { .status = T_RunStatus_Fail };
|
||||
T_RunResult result_ = { .status = T_RunStatus_Fail };
|
||||
|
||||
#define T_EndTest \
|
||||
result.status = T_RunStatus_Pass; \
|
||||
exit__:; \
|
||||
scratch_end(scratch); \
|
||||
return result; \
|
||||
#define T_EndTest \
|
||||
result_.status = T_RunStatus_Pass; \
|
||||
exit__:; \
|
||||
scratch_end(scratch); \
|
||||
return result_; \
|
||||
}
|
||||
|
||||
#define T_Ok(c) do { if (!(c)) { result.fail_file = __FILE__; result.fail_line = __LINE__; result.fail_cond = Stringify(c); goto exit__; } } while(0)
|
||||
#define T_Ok(c) do { if (!(c)) { result_.fail_file = __FILE__; result_.fail_line = __LINE__; result_.fail_cond = Stringify(c); goto exit__; } } while(0)
|
||||
#define T_MatchLinef(out, ...) T_Ok(t_match_linef(out, __VA_ARGS__))
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
Reference in new issue
Block a user