[chirp_devel] [PATCH] Add Support for Settings UnitTest
# HG changeset patch # User K. Arvanitis kosta@alumni.uvic.ca # Date 1421988817 28800 # Thu Jan 22 20:53:37 2015 -0800 # Node ID e347fdbfc9c2ce3a80bf037c2a7667afda8eed13 # Parent b25606106a9c0cd78f3cc5f602475da64cde081d [PATCH] Add Support for Settings UnitTest Add a basic unit test coverage of the radio Settings API. Currently, all but one image passes the test (UV3R). Commented out offending code in uv3r module. Feature #2235 diff -r b25606106a9c -r e347fdbfc9c2 chirp/baofeng_uv3r.py --- a/chirp/baofeng_uv3r.py Wed Jan 21 23:30:19 2015 -0800 +++ b/chirp/baofeng_uv3r.py Thu Jan 22 20:53:37 2015 -0800 @@ -421,42 +421,6 @@ CH_FLAG_LIST[_settings.ch_flag])) basic.append(rs)
- _limit = int(self._memobj.limits.lower_vhf) / 10 - rs = RadioSetting("limits.lower_vhf", "VHF Lower Limit (115-239 MHz)", - RadioSettingValueInteger(115, 235, _limit)) - def apply_limit(setting, obj): - value = int(setting.value) * 10 - obj.lower_vhf = value - rs.set_apply_callback(apply_limit, self._memobj.limits) - basic.append(rs) - - _limit = int(self._memobj.limits.upper_vhf) / 10 - rs = RadioSetting("limits.upper_vhf", "VHF Upper Limit (115-239 MHz)", - RadioSettingValueInteger(115, 235, _limit)) - def apply_limit(setting, obj): - value = int(setting.value) * 10 - obj.upper_vhf = value - rs.set_apply_callback(apply_limit, self._memobj.limits) - basic.append(rs) - - _limit = int(self._memobj.limits.lower_uhf) / 10 - rs = RadioSetting("limits.lower_uhf", "UHF Lower Limit (200-529 MHz)", - RadioSettingValueInteger(200, 529, _limit)) - def apply_limit(setting, obj): - value = int(setting.value) * 10 - obj.lower_uhf = value - rs.set_apply_callback(apply_limit, self._memobj.limits) - basic.append(rs) - - _limit = int(self._memobj.limits.upper_uhf) / 10 - rs = RadioSetting("limits.upper_uhf", "UHF Upper Limit (200-529 MHz)", - RadioSettingValueInteger(200, 529, _limit)) - def apply_limit(setting, obj): - value = int(setting.value) * 10 - obj.upper_uhf = value - rs.set_apply_callback(apply_limit, self._memobj.limits) - basic.append(rs) - vfo_preset = RadioSettingGroup("vfo_preset", "VFO Presets") group.append(vfo_preset)
diff -r b25606106a9c -r e347fdbfc9c2 tests/run_tests --- a/tests/run_tests Wed Jan 21 23:30:19 2015 -0800 +++ b/tests/run_tests Thu Jan 22 20:53:37 2015 -0800 @@ -520,8 +520,30 @@ self.do_badname(rf)
return [] + TESTS["Edges"] = TestCaseEdges
+ +class TestCaseSettings(TestCase): + def __str__(self): + return "Settings" + + def do_get_settings(self, rf): + self._wrapper.do("get_settings") + + def run(self): + rf = self._wrapper.do("get_features") + + if not rf.has_settings: + raise TestSkippedError("Settings not supported") + + self.do_get_settings(rf) + + return [] + +TESTS["Settings"] = TestCaseSettings + + class TestCaseBanks(TestCase): def __str__(self): return "Banks"
[PATCH] Add Support for Settings UnitTest Add a basic unit test coverage of the radio Settings API. Currently, all but one image passes the test (UV3R). Commented out offending code in uv3r module.
This is great, thanks! I'd rather not just disable the settings in the UV3R driver to add this. Do the failures look resolvable?
Also, the commit message says "commented out" but actually remove the code.
If you want to send just a patch with the test bit, I'll see if I can fix the UV3 driver and then apply it.
--Dan
Currently, none of the settings load in under the UV3-R radio since these settings fail.
They do look resolvable, however without a radio I cannot test. It appears that the memory block at the location which chirp is reading these settings from has the memory bits all set (0xFF) where it expects to find a valid frequency. I compared this to the free UV3-R tool (old) and it appears to set the bits correctly, wears the image in the tests does not. It may be a possible that the image is a diff. model or variant of the previous uv3r.
I will put a patch together with only the test code if you would like to try resolving it as I believe the settings test still remains useful.
Date: Wed, 28 Jan 2015 17:37:32 -0800 From: dsmith@danplanet.com To: chirp_devel@intrepid.danplanet.com Subject: Re: [chirp_devel] [PATCH] Add Support for Settings UnitTest
[PATCH] Add Support for Settings UnitTest Add a basic unit test coverage of the radio Settings API. Currently, all but one image passes the test (UV3R). Commented out offending code in uv3r module.
This is great, thanks! I'd rather not just disable the settings in the UV3R driver to add this. Do the failures look resolvable?
Also, the commit message says "commented out" but actually remove the code.
If you want to send just a patch with the test bit, I'll see if I can fix the UV3 driver and then apply it.
--Dan
_______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (2)
-
Dan Smith
-
Kosta Arvanitis