mirror of https://github.com/commaai/panda.git
safety tests: fix measurement test (#1679)
* Update common.py * without abs and only negative values: this is not caught (since negative error < 1) * ugly draft * this catches it * draft * draft * draft * works now! * no blurry tests * ugh subaru is like this too * okay some can scaling makes it slightly off (wheel speeds) * uncommont * clean up
This commit is contained in:
parent
635db84095
commit
846c807797
|
@ -640,8 +640,8 @@ class MeasurementSafetyTest(PandaSafetyTestBase):
|
|||
self.assertTrue(self._rx(msg_func(val + i * 0.1)))
|
||||
|
||||
# assert close by one decimal place
|
||||
self.assertLessEqual(abs(get_min_func() - val * factor), 1 * abs(factor))
|
||||
self.assertLessEqual(abs(get_max_func() - (val + 0.5) * factor), 1 * abs(factor))
|
||||
self.assertAlmostEqual(get_min_func() / factor, val, delta=0.1)
|
||||
self.assertAlmostEqual(get_max_func() / factor - 0.5, val, delta=0.1)
|
||||
|
||||
# reset sample_t by reinitializing the safety mode
|
||||
self._reset_safety_hooks()
|
||||
|
|
Loading…
Reference in New Issue