[chirp_devel] [PATCH 3 of 3] Add a test to look for contradictions in radio_features
IZ3GME Marco
Tue Jul 3 02:47:20 PDT 2012
Hi ... here I am again :)
First of all _I like the new test!_
more, we should add also the needed check for tone features.
But according to the usage matrix the _check_rx_dtcs is wrong as the
check shoud be:
if "DTCS->DTCS" in cross_mode and not rf.has_rx_dtcs:
being "DTCS->DTCS" the only case where has_rx_dtcs is mandatory.
73 de IZ3GME Marco
On 30/06/2012 03:22, Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith <dsmith at danplanet.com>
> # Date 1341019320 25200
> # Node ID 8a6ee39c727dc84dff1eebe2b4121ff4f17f7926
> # Parent ad0be2483a7cb68e85c2ffdd597befcfcfdfca54
> Add a test to look for contradictions in radio_features
>
> diff -r ad0be2483a7c -r 8a6ee39c727d tests/run_tests
> --- a/tests/run_tests Fri Jun 29 18:22:00 2012 -0700
> +++ b/tests/run_tests Fri Jun 29 18:22:00 2012 -0700
> @@ -180,9 +180,9 @@
> ):
> continue
> elif k == "dtcs" and ((a.tmode != "DTCS") or
> - (a.tmode == "Cross" and tx_mode != "DTCS")):
> + (a.tmode != "Cross" or tx_mode != "DTCS")):
> continue
> - elif k == "rx_dtcs" and (a.tmode == "Cross" and rx_mode != "DTCS"):
> + elif k == "rx_dtcs" and (a.tmode != "Cross" or rx_mode != "DTCS"):
> continue
> elif k == "offset" and not a.duplex:
> continue
> @@ -765,6 +765,36 @@
>
> TESTS["Clone"] = TestCaseClone
>
> +class TestFeatures(TestCase):
> + def _check_cross_modes(self):
> + rf = self._wrapper.do("get_features")
> +
> + if "Cross" in rf.valid_tmodes and not rf.valid_cross_modes:
> + raise TestFailedError("Radio claims Cross tone mode support, "
> + "but declares none")
> + if "Cross" not in rf.valid_tmodes and rf.valid_cross_modes:
> + raise TestFailedError("Radio claims no Cross tone mode support, "
> + "yet declares some")
> +
> + def _check_rx_dtcs(self):
> + rf = self._wrapper.do("get_features")
> +
> + for cross_mode in rf.valid_cross_modes:
> + if "->DTCS" in cross_mode and not rf.has_rx_dtcs:
> + raise TestFailedError("Radio has receive DTCS cross mode, "
> + "yet not has_rx_dtcs")
> +
> + def run(self):
> + self._check_cross_modes()
> + self._check_rx_dtcs()
> +
> + return []
> +
> + def __str__(self):
> + return "Features"
> +
> +TESTS["Features"] = TestFeatures
> +
> class TestOutput:
> def __init__(self, output=None):
> if not output:
> _______________________________________________
> chirp_devel mailing list
> chirp_devel at intrepid.danplanet.com
> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
>
More information about the chirp_devel
mailing list