diff --git a/src/init.c b/src/init.c index 02011b42..df306370 100644 --- a/src/init.c +++ b/src/init.c @@ -1125,6 +1125,12 @@ ProcessLongOption(char const *arg) if (!strcmp(arg, "test")) { fprintf(stderr, "Enabling test mode: This is meant for the acceptance test.\nDo not use --test in production.\n"); TestMode = 1; + + /* Update RealToday because of TestMode */ + RealToday = SystemDate(&CurYear, &CurMon, &CurDay); + DSEToday = RealToday; + FromDSE(DSEToday, &CurYear, &CurMon, &CurDay); + return; } if (!strcmp(arg, "version")) { diff --git a/src/main.c b/src/main.c index 315062ac..bd54ab2a 100644 --- a/src/main.c +++ b/src/main.c @@ -1050,6 +1050,9 @@ int SystemDate(int *y, int *m, int *d) /* In test mode, always return 6 January 2025 */ if (TestMode) { + *y = 2025; + *m = 0; + *d = 6; return 12803; /* 2025-01-06 */ }