Differences From Artifact [0b419cd689]:
- File tests/TestsAppDelegate.m — part of check-in [e73c65a849] at 2021-04-18 22:56:46 on branch new-naming-convention — Rename all symbols marked extern (user: js, size: 9624) [annotate] [blame] [check-ins using] [more...]
To Artifact [1130ab2e6c]:
- File
tests/TestsAppDelegate.m
— part of check-in
[14f1e22d79]
at
2021-05-08 23:22:59
on branch trunk
— tests: Align more with ObjFW style
ObjFW's style changed over the years, but the tests were never adjusted
to it. (user: js, size: 9652) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
47 48 49 50 51 52 53 54 55 | #ifdef OF_NINTENDO_3DS /* Newer versions of libctru started using id as a parameter name. */ # define id id_3ds # include <3ds.h> # undef id #endif #ifdef OF_PSP static int | > > | | | | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | #ifdef OF_NINTENDO_3DS /* Newer versions of libctru started using id as a parameter name. */ # define id id_3ds # include <3ds.h> # undef id #endif extern unsigned long OFHashSeed; #ifdef OF_PSP static int exitCallback(int arg1, int arg2, void *arg) { sceKernelExitGame(); return 0; } static int threadCallback(SceSize args, void *argp) { sceKernelRegisterExitCallback( sceKernelCreateCallback("Exit Callback", exitCallback, NULL)); sceKernelSleepThreadCB(); return 0; } #endif int main(int argc, char *argv[]) { #ifdef OF_PSP int tid; #endif #if defined(OF_OBJFW_RUNTIME) && !defined(OF_WINDOWS) && !defined(OF_AMIGAOS) /* * This does not work on Win32 if ObjFW is built as a DLL. * * On AmigaOS, some destructors need to be able to send messages. * Calling objc_deinit() via atexit() would result in the runtime being * destructed before for the destructors ran. */ atexit(objc_deinit); #endif /* We need deterministic hashes for tests */ OFHashSeed = 0; #ifdef OF_WII GXRModeObj *rmode; |
︙ | ︙ | |||
116 117 118 119 120 121 122 | #ifdef OF_PSP pspDebugScreenInit(); sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL); | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #ifdef OF_PSP pspDebugScreenInit(); sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL); if ((tid = sceKernelCreateThread("update_thread", threadCallback, 0x11, 0xFA0, 0, 0)) >= 0) sceKernelStartThread(tid, 0, 0); #endif #ifdef OF_NINTENDO_DS consoleDemoInit(); #endif |
︙ | ︙ | |||
194 195 196 197 198 199 200 | } #else return OFApplicationMain(&argc, &argv, [[TestsAppDelegate alloc] init]); #endif } @implementation TestsAppDelegate | | < | < | < | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | } #else return OFApplicationMain(&argc, &argv, [[TestsAppDelegate alloc] init]); #endif } @implementation TestsAppDelegate - (void)outputTesting: (OFString *)test inModule: (OFString *)module { if (OFStdOut.hasTerminal) { [OFStdOut setForegroundColor: [OFColor yellow]]; [OFStdOut writeFormat: @"[%@] %@: testing...", module, test]; } else [OFStdOut writeFormat: @"[%@] %@: ", module, test]; } - (void)outputSuccess: (OFString *)test inModule: (OFString *)module { if (OFStdOut.hasTerminal) { [OFStdOut setForegroundColor: [OFColor lime]]; [OFStdOut eraseLine]; [OFStdOut writeFormat: @"\r[%@] %@: ok\n", module, test]; } else [OFStdOut writeLine: @"ok"]; } - (void)outputFailure: (OFString *)test inModule: (OFString *)module { if (OFStdOut.hasTerminal) { [OFStdOut setForegroundColor: [OFColor red]]; [OFStdOut eraseLine]; [OFStdOut writeFormat: @"\r[%@] %@: failed\n", module, test]; #ifdef OF_WII |
︙ | ︙ |