Match Jimmy controller arithmetic and facing to original probes
This commit is contained in:
1 parent
42ea2b8cd5
commit
0e2f426d42
60 files changed
+6027
-48
No files matched your search
@@ -0,0 +1,24 @@
|
||||
"""Source/provenance guards for original Jimmy keyboard-ground components."""
|
||||
from pathlib import Path
|
||||
import collections,hashlib,json,sys,unittest
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0,str(ROOT/'tools/binary'))
|
||||
from jimmy_ground_motion import collect
|
||||
class JimmyGroundEvidence(unittest.TestCase):
|
||||
def test_original_identity_ranges_and_offsets(self):
|
||||
source=collect(ROOT.parent/'Original');fixture=json.loads((ROOT/'tests/GamePort.JimmyGroundTests/original-ground-reference.json').read_text())
|
||||
for field in ('source_sha256','dll_sha256','ranges'):self.assertEqual(source[field],fixture[field])
|
||||
self.assertEqual(len(source['ranges']),6)
|
||||
for row in source['ranges']:self.assertEqual(int(row['file_offset'],16),int(row['va'],16)-0x400000)
|
||||
def test_probe_provenance_and_complete_native_observations(self):
|
||||
fixture=json.loads((ROOT/'tests/GamePort.JimmyGroundTests/original-ground-reference.json').read_text())
|
||||
for path,digest in fixture['files'].items():
|
||||
if path.startswith('tools/'):self.assertEqual(hashlib.sha256((ROOT/path).read_bytes()).hexdigest(),digest)
|
||||
self.assertEqual(collections.Counter(c['kind'] for c in fixture['cases']),dict(INPUT=17,APPLY=8))
|
||||
rows={c['name']:c for c in fixture['cases']}
|
||||
self.assertEqual(rows['overcap']['observed'][0],700)
|
||||
self.assertEqual(rows['ground']['observed'][1],-237)
|
||||
self.assertEqual(rows['ground_nopoly']['observed'][1],13)
|
||||
self.assertEqual(rows['backequal']['observed'][0],-52.5)
|
||||
self.assertEqual(rows['backturn']['observed'][0],600)
|
||||
if __name__=='__main__':unittest.main()
|
||||
Reference in new issue
Block a user