summaryrefslogtreecommitdiff
path: root/test/message.cpp
diff options
context:
space:
mode:
authorNick Hollinghurst <nick.hollinghurst@raspberrypi.com>2023-12-06 17:27:43 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-01-09 15:39:02 +0000
commite71d63ce1bfa9784e18852fec264357bda5e3671 (patch)
tree0f609ccc032c363d9fee9a9020a36151ea47bb94 /test/message.cpp
parent12fb8ed5cbcd064de860928ede30abc9273fb743 (diff)
ipa: rpi: Allow the mean of an empty histogram interval
Don't assert when taking the weighted mean of a zero-width or zero-weight interval; return its upper bound. That is certainly correct in the zero-width case, and plausible otherwise. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/message.cpp')
0 files changed, 0 insertions, 0 deletions
span>: int run() override; }; int FormatHandlingTest::run() { V4L2SubdeviceFormat format = {}; /* * Get format on a non-existing Scaler pad: expect failure. */ int ret = scaler_->getFormat(2, &format); if (!ret) { cerr << "Getting format on a non existing pad should fail" << endl; return TestFail; } ret = scaler_->getFormat(0, &format); if (ret) { cerr << "Failed to get format" << endl; return TestFail; } /* * Set unrealistic image resolutions and make sure it gets updated. */ format.size = { UINT_MAX, UINT_MAX }; ret = scaler_->setFormat(0, &format); if (ret) { cerr << "Failed to set format: image resolution is wrong, but " << "setFormat() should not fail." << endl; return TestFail; } if (format.size.width == UINT_MAX || format.size.height == UINT_MAX) { cerr << "Failed to update image format" << endl; return TestFail; } format.size = { 0, 0 }; ret = scaler_->setFormat(0, &format); if (ret) { cerr << "Failed to set format: image resolution is wrong, but " << "setFormat() should not fail." << endl; return TestFail; } if (format.size.width == 0 || format.size.height == 0) { cerr << "Failed to update image format" << endl; return TestFail; } return TestPass; } TEST_REGISTER(FormatHandlingTest);