Build independent base gameplay and source-bound native verification
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from policy_harness import ROOT, body, run
|
||||
p = ROOT / 'addons/core/Scripts/Game/ERR/ERR_RecoveryService.c'
|
||||
rules = body(p, 'static int SurvivorKind(') + '\n' + body(p, 'static bool NeedsRescuer(')
|
||||
run('''#include <cassert>
|
||||
''' + rules + '''
|
||||
int main() {
|
||||
for (int flags=0;flags<16;flags++) {
|
||||
bool alive=flags&1, connected=flags&2, same=flags&4, conscious=flags&8;
|
||||
int expected=!alive?0:(!connected||!same)?1:conscious?2:3;
|
||||
assert(SurvivorKind(alive,connected,same,conscious)==expected);
|
||||
}
|
||||
for (int conscious=0;conscious<=12;conscious++)
|
||||
for (int incapacitated=0;incapacitated<=12;incapacitated++)
|
||||
assert(NeedsRescuer(conscious,incapacitated)==(conscious==0&&incapacitated>0));
|
||||
}
|
||||
''')
|
||||
print('PASS: recovery state excludes dead bodies, preserves reservations, requires controlled rescuers and distinguishes empty/all-dead teams')
|
||||
Reference in New Issue
Block a user