IC-R6 failing Tox test_sync_out
Hi everyone,
The new IC-R6 driver is failing one test:
Failed tests/unit/test_icom_clone.py::Test_Icom_IC-R6::test_sync_out 1 ms self = <tests.unit.test_icom_clone.Test_Icom_IC-R6 testMethod=test_sync_out>
def test_sync_out(self): self.radio._mmap = memmap.MemoryMapBytes( bytes(b'\x00') * self.radio.get_memsize()) self.radio._mmap[50] = bytes(b'abcdefgh') self.radio.sync_out()
self.assertEqual(b'abcdefgh', self.simulator._memory[50:58])
E AssertionError: b'abcdefgh' != b''
tests/unit/test_icom_clone.py:78: AssertionError
Memsize looks fine, though the exported image has a trailing base64 string which decodes as:
{"mem_extra": {}, "rclass": "ICR6Radio", "vendor": "Icom", "model": "IC-R6", "variant": "", "chirp_version": "py3dev"}
Some other Icom image files such as Icom_IC-W32E.img end with the standard Icom_IC-W32E.img<null> but I see Icom_ID-80H.img also has base64 at the end:
{"mem_extra": {}, "rclass": "ID80Radio", "vendor": "Icom", "model": "ID-80H", "variant": "", "chirp_version": "py3dev"}
Perhaps that's OK?
Saved the image file back out as ICF and it loaded fine in Icom's CS-R6 - had to change one value from 000000 to 002A to get "#EtcData=002A" but that's related to US/Europe variant.
Haven't tried writing to my radio yet. Using the standard library ICF3 code, don't have sync_out() in the IC-R6 class.
Thoughts on why test_sync_out() could be failing please?
Regards,
John.
The new IC-R6 driver is failing one test: Failed tests/unit/test_icom_clone.py::Test_Icom_IC-R6::test_sync_out 1 ms self = <tests.unit.test_icom_clone.Test_Icom_IC-R6 testMethod=test_sync_out>
def test_sync_out(self): self.radio._mmap = memmap.MemoryMapBytes( bytes(b'\x00') * self.radio.get_memsize()) self.radio._mmap[50] = bytes(b'abcdefgh') self.radio.sync_out()
self.assertEqual(b'abcdefgh', self.simulator._memory[50:58])
E AssertionError: b'abcdefgh' != b''
This is making sure that the driver actually performs a clone-out. It's setting the memory map to some known thing and then checking that the clone simulator got that at the expected offset after an upload. From a quick look at your code, it looks like you're not setting _ranges on your radio class, which is a field the icf base uses to determine what to actually write. This is not just a test failure but will prevent it from *actually* writing to the radio, so that definitely needs to be fixed.
https://github.com/kk7ds/chirp/blob/master/chirp/drivers/icf.py#L810
Some icom radios don't send the whole image on upload, and some of them send the pieces that they do in chunks of differing block sizes. So you need to tell the ICF base driver how you want it sent. Without that, it will just start the clone, never send any data, and then end the clone.
Memsize looks fine, though the exported image has a trailing base64 string which decodes as: {"mem_extra": {}, "rclass": "ICR6Radio", "vendor": "Icom", "model": "IC-R6", "variant": "", "chirp_version": "py3dev"} Some other Icom image files such as Icom_IC-W32E.img end with the standard Icom_IC-W32E.img<null> but I see Icom_ID-80H.img also has base64 at the end: {"mem_extra": {}, "rclass": "ID80Radio", "vendor": "Icom", "model": "ID-80H", "variant": "", "chirp_version": "py3dev"} Perhaps that's OK?
This is the CHIRP metadata, which is added to all image files (in recent years, some test images are older). You can ignore it, CHIRP adds and strips it on save/load.
--Dan
participants (2)
-
Dan Smith
-
John Bradshaw