mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
Fix tracing path and display issues
This commit is contained in:
@@ -161,15 +161,23 @@ void main() {
|
||||
expect(selection.mode, PathSelectionMode.flood);
|
||||
});
|
||||
|
||||
test('received public byte path is added to history', () async {
|
||||
final service = PathHistoryService();
|
||||
await service.initialize();
|
||||
await service.recordReceivedBytePath('abc123', [0x01, 0x02, 0x03], 3);
|
||||
test(
|
||||
'received public byte path is reversed before adding to history',
|
||||
() async {
|
||||
final service = PathHistoryService();
|
||||
await service.initialize();
|
||||
await service.recordReceivedBytePath('abc123', [
|
||||
0x01,
|
||||
0x02,
|
||||
0x03,
|
||||
0x04,
|
||||
], 2);
|
||||
|
||||
final history = service.historyFor('abc123');
|
||||
expect(history.directPaths, hasLength(1));
|
||||
expect(history.directPaths.single.pathBytes, [0x01, 0x02, 0x03]);
|
||||
expect(history.directPaths.single.hashSize, 3);
|
||||
expect(history.directPaths.single.hopCount, 1);
|
||||
});
|
||||
final history = service.historyFor('abc123');
|
||||
expect(history.directPaths, hasLength(1));
|
||||
expect(history.directPaths.single.pathBytes, [0x03, 0x04, 0x01, 0x02]);
|
||||
expect(history.directPaths.single.hashSize, 2);
|
||||
expect(history.directPaths.single.hopCount, 2);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user