mirror of
https://github.com/phantomptr/ps5upload.git
synced 2026-10-19 02:20:02 -05:00
Upload, install, convert and manage PS5 game packages over the network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
962 B
C
29 lines
962 B
C
/* Host proof for the wake watchdog's fail-closed recovery gate. */
|
|
#include "wake_watchdog.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
static int failures = 0;
|
|
|
|
static void check(int ok, const char *label) {
|
|
printf(" %s %s\n", ok ? "PASS" : "FAIL", label);
|
|
if (!ok) failures++;
|
|
}
|
|
|
|
int main(void) {
|
|
check(!wake_watchdog_should_recover(5, 5, 0),
|
|
"ordinary poll never recovers");
|
|
check(!wake_watchdog_should_recover(3600, 5, 0),
|
|
"wall-clock/NTP jump alone never performs kernel writes");
|
|
check(!wake_watchdog_should_recover(3600, 3600, 1),
|
|
"BigApp throttle never recovers");
|
|
check(!wake_watchdog_should_recover(3600, 3600, -1),
|
|
"unknown process scan fails closed");
|
|
check(wake_watchdog_should_recover(3600, 3600, 0),
|
|
"two-clock suspend evidence with no BigApp recovers");
|
|
|
|
printf("\nwake_watchdog_selftest: %s\n",
|
|
failures == 0 ? "ALL PASS" : "FAILED");
|
|
return failures == 0 ? 0 : 1;
|
|
}
|