︙ | | |
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
43
44
45
46
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#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_NINTENDO_SWITCH
# define id nx_id
# include <switch.h>
# undef id
static OFDate *lastConsoleUpdate;
static void
updateConsole(bool force)
{
if (force || lastConsoleUpdate.timeIntervalSinceNow <= -1.0 / 60) {
consoleUpdate(NULL);
[lastConsoleUpdate release];
lastConsoleUpdate = [[OFDate alloc] init];
}
}
#endif
@interface OTAppDelegate: OFObject <OFApplicationDelegate>
@end
enum Status {
StatusRunning,
StatusOk,
|
︙ | | |
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
+
+
+
+
|
#elif defined(OF_NINTENDO_DS)
consoleDemoInit();
#elif defined(OF_NINTENDO_3DS)
gfxInitDefault();
atexit(gfxExit);
consoleInit(GFX_TOP, NULL);
#elif defined(OF_NINTENDO_SWITCH)
consoleInit(NULL);
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
updateConsole(true);
#endif
}
- (OFSet OF_GENERIC(Class) *)testClasses
{
Class *classes = objc_copyClassList(NULL);
OFMutableSet *testClasses;
|
︙ | | |
265
266
267
268
269
270
271
272
273
274
275
276
277
278
|
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
+
+
+
+
+
+
+
+
+
+
+
+
+
|
hidScanInput();
if (hidKeysDown() & KEY_A)
break;
gspWaitForVBlank();
}
#elif defined(OF_NINTENDO_SWITCH)
[OFStdOut setForegroundColor: [OFColor silver]];
[OFStdOut writeLine: @"Press A to continue"];
while (appletMainLoop()) {
PadState pad;
padUpdate(&pad);
updateConsole(true);
if (padGetButtonsDown(&pad) & HidNpadButton_A)
break;
}
#endif
}
}
- (OFString *)descriptionForException: (id)exception
{
OFMutableString *description = [OFMutableString
|
︙ | | |
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
|
-
+
+
|
{
OFSet OF_GENERIC(Class) *testClasses = [self testClasses];
size_t numSucceeded = 0, numFailed = 0, numSkipped = 0;
OFMutableDictionary *summaries = [OFMutableDictionary dictionary];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeString: @"Found "];
#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
#if !defined(OF_WII) && !defined(OF_NINTENDO_DS) && \
!defined(OF_NINTENDO_3DS) && !defined(OF_NINTENDO_SWITCH)
[OFStdOut setForegroundColor: [OFColor fuchsia]];
#endif
[OFStdOut writeFormat: @"%zu", testClasses.count];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeFormat: @" test case%s\n",
(testClasses.count != 1 ? "s" : "")];
|
︙ | | |
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
|
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
|
-
+
+
-
+
+
-
+
+
|
[OFStdOut setForegroundColor: [OFColor navy]];
[OFStdOut writeFormat: @"%@: ", line.firstObject];
[OFStdOut setForegroundColor: [OFColor blue]];
[OFStdOut writeFormat: @"%@\n", line.secondObject];
}
}
#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
#if !defined(OF_WII) && !defined(OF_NINTENDO_DS) && \
!defined(OF_NINTENDO_3DS) && !defined(OF_NINTENDO_SWITCH)
[OFStdOut setForegroundColor: [OFColor fuchsia]];
#else
[OFStdOut setForegroundColor: [OFColor purple]];
#endif
[OFStdOut writeFormat: @"%zu", numSucceeded];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeFormat: @" test%s succeeded, ",
(numSucceeded != 1 ? "s" : "")];
#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
#if !defined(OF_WII) && !defined(OF_NINTENDO_DS) && \
!defined(OF_NINTENDO_3DS) && !defined(OF_NINTENDO_SWITCH)
[OFStdOut setForegroundColor: [OFColor fuchsia]];
#endif
[OFStdOut writeFormat: @"%zu", numFailed];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeFormat: @" test%s failed, ",
(numFailed != 1 ? "s" : "")];
#if !defined(OF_WII) && !defined(OF_NINTENDO_3DS)
#if !defined(OF_WII) && !defined(OF_NINTENDO_DS) && \
!defined(OF_NINTENDO_3DS) && !defined(OF_NINTENDO_SWITCH)
[OFStdOut setForegroundColor: [OFColor fuchsia]];
#endif
[OFStdOut writeFormat: @"%zu", numSkipped];
[OFStdOut setForegroundColor: [OFColor purple]];
[OFStdOut writeFormat: @" test%s skipped\n",
(numSkipped != 1 ? "s" : "")];
[OFStdOut reset];
|
︙ | | |
515
516
517
518
519
520
521
522
523
524
525
526
|
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
|
+
+
+
+
+
|
hidScanInput();
if (hidKeysDown() & KEY_START)
break;
gspWaitForVBlank();
}
#elif defined(OF_NINTENDO_SWITCH)
while (appletMainLoop())
updateConsole(true);
consoleExit(NULL);
#endif
[OFApplication terminateWithStatus: (int)numFailed];
}
@end
|