Package test knows openbmh.dat; week_check reports the distance of late day snapshots
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e593f921f
commit
20f5e4eb28
2 files changed
+6
-4
No files matched your search
@@ -23,7 +23,7 @@ class PackageAllowlistTests(unittest.TestCase):
|
||||
root = Path(directory)
|
||||
# Empty authored placeholders test names/structure, not executable behavior.
|
||||
for name in ['OpenBMH', 'openbmh_cli', 'README.md', 'LICENSE',
|
||||
'THIRD_PARTY_NOTICES.md', 'ACKNOWLEDGEMENTS.md', 'CONTRIBUTING.md']:
|
||||
'THIRD_PARTY_NOTICES.md', 'ACKNOWLEDGEMENTS.md', 'CONTRIBUTING.md', 'openbmh.dat']:
|
||||
(root / name).write_text('synthetic')
|
||||
notes = root / 'docs/release/1.0/RELEASE_NOTES.md'
|
||||
notes.parent.mkdir(parents=True)
|
||||
|
||||
@@ -1057,10 +1057,11 @@ const Entry* desk = &pause; // (after an offer message box the next pause)
|
||||
GameRandom gp = bg;
|
||||
WatcomRandom wp = br;
|
||||
bool g_ahead = false, w_ahead = false;
|
||||
long g_steps = 0, w_steps = 0; // draws the snapshot lies ahead of our state (reported below)
|
||||
for (long k = 0; k < 20000 && !g_ahead; k++, gp.range(0, 1))
|
||||
g_ahead = gp.seed() == int32_t(std::stoll(field(e.line, "game_seed")));
|
||||
g_ahead = gp.seed() == int32_t(std::stoll(field(e.line, "game_seed"))), g_steps = k;
|
||||
for (long k = 0; k < 20000 && !w_ahead; k++, wp.rand())
|
||||
w_ahead = wp.seed() == uint32_t(std::stoull(field(e.line, "rand_seed")));
|
||||
w_ahead = wp.seed() == uint32_t(std::stoull(field(e.line, "rand_seed"))), w_steps = k;
|
||||
if (!w_ahead) {
|
||||
// (a Watcom seed on no path of the stream: the snapshot caught a temporary generator
|
||||
// state, as with minute snapshots - not counted)
|
||||
@@ -1085,7 +1086,8 @@ const Entry* desk = &pause; // (after an offer message box the next pause)
|
||||
}
|
||||
}
|
||||
if (!g_ahead || !w_ahead) return false;
|
||||
std::printf(" (late snapshot: taken inside the processing of day %u, not counted)\n", b.date);
|
||||
std::printf(" (late snapshot: taken inside the processing of day %u, %ld game and %ld Watcom draws ahead of the "
|
||||
"port's state, both on the port's streams; not counted)\n", b.date, g_steps, w_steps);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user