mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-23 21:33:53 +00:00
Verify picker disclosure of Indicator render memory tradeoffs
This commit is contained in:
1 parent
bbda0ee2ea
commit
5353a237a0
2 files changed
+14
-1
No files matched your search
@@ -30,6 +30,7 @@ def capacity_note(reductions, defines):
|
||||
for reduction in reductions:
|
||||
if reduction == 'display.canvas limited to 320x320 internal pixels, scaled to the 480x480 panel; 350 contacts, 512 queued frames and all Full transports retained':
|
||||
notes.append('Display renders at 320x320 and scales to the 480x480 panel to preserve internal RAM. All Full transports, 350 contacts, 512 queued messages and full-length message previews are retained.')
|
||||
continue
|
||||
contacts = re.fullmatch(r'companion.capacity limited to (\d+) contacts for runtime RAM; (\d+) queued frames and all Full transports retained', reduction)
|
||||
compact = re.fullmatch(r'companion.capacity limited to (\d+) contacts, (\d+) channels, and (\d+) queued frames by measured internal DRAM', reduction)
|
||||
queue = re.fullmatch(r'nRF52 Full: (\d+) offline frames normally; (\d+) while mOTA borrows queue storage', reduction)
|
||||
@@ -61,7 +62,7 @@ def capacity_note(reductions, defines):
|
||||
notes.append(f'Neighbor table: {neighbors[1]} entries.')
|
||||
elif rules:
|
||||
notes.append(f'Flood rules: {rules[1]} entries; the complete rule engine is retained.')
|
||||
elif reduction.startswith(('companion.capacity', 'nRF52 Full:', 'Wireless Paper Full:', 'mesh.neighbors', 'mesh.flood_rules')):
|
||||
elif reduction.startswith(('companion.capacity', 'nRF52 Full:', 'Wireless Paper Full:', 'mesh.neighbors', 'mesh.flood_rules', 'display.canvas')):
|
||||
raise ValueError('Unrecognized capacity reduction: ' + reduction)
|
||||
return ' '.join(notes)
|
||||
|
||||
|
||||
@@ -109,6 +109,18 @@ class PickerControlsTests(unittest.TestCase):
|
||||
self.assertNotIn('memoryNote', control)
|
||||
self.assertNotIn('memorySource', control)
|
||||
|
||||
def test_indicator_canvas_tradeoff_preserves_psram_capacities(self):
|
||||
control = self.generate([
|
||||
'display.canvas limited to 320x320 internal pixels, scaled to the 480x480 panel; 350 contacts, 512 queued frames and all Full transports retained',
|
||||
])
|
||||
self.assertIn('320x320', control['memoryNote'])
|
||||
self.assertIn('480x480 panel', control['memoryNote'])
|
||||
self.assertIn('350 contacts, 512 queued messages', control['memoryNote'])
|
||||
self.assertIn('full-length message previews', control['memoryNote'])
|
||||
self.assertEqual(control['memorySource'], 'a' * 40)
|
||||
with self.assertRaisesRegex(ValueError, 'Unrecognized capacity reduction'):
|
||||
self.generate(['display.canvas changed without numeric limits'])
|
||||
|
||||
def test_unknown_capacity_formats_are_not_silently_discarded(self):
|
||||
with self.assertRaisesRegex(ValueError, 'Unrecognized capacity reduction'):
|
||||
self.generate(['companion.capacity changed without numeric limits'])
|
||||
|
||||
Reference in new issue
Block a user