summaryrefslogtreecommitdiff
path: root/utils/raspberrypi/ctt/ctt_alsc.py
AgeCommit message (Collapse)Author
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E302Laurent Pinchart
E302 expected 2 blank lines, found 0 Note that issues are still flagged, due to the use of docstrings as multi-lines comments. This will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E305Laurent Pinchart
E305 expected 2 blank lines after class or function definition Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E303Laurent Pinchart
E303 too many blank lines Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E228Laurent Pinchart
E228 missing whitespace around modulo operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E225Laurent Pinchart
E225 missing whitespace around operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E251Laurent Pinchart
E251 unexpected spaces around keyword / parameter equals Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E231Laurent Pinchart
E231 missing whitespace after ',' E231 missing whitespace after ':' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-11libcamera: utils: Raspberry Pi Camera Tuning ToolNaushir Patuck
Initial implementation of the Raspberry Pi (BCM2835) Camera Tuning Tool. All code is licensed under the BSD-2-Clause terms. Copyright (c) 2019-2020 Raspberry Pi Trading Ltd. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
ss="hl kwc">class ControlListTest : public CameraTest, public Test { public: ControlListTest() : CameraTest("VIMC Sensor B") { } protected: int init() override { return status_; } int run() override { CameraControlValidator validator(camera_.get()); ControlList list(controls::controls, &validator); /* Test that the list is initially empty. */ if (!list.empty()) { cout << "List should to be empty" << endl; return TestFail; } if (list.size() != 0) { cout << "List should contain zero items" << endl; return TestFail; } if (list.contains(controls::Brightness)) { cout << "List should not contain Brightness control" << endl; return TestFail; } unsigned int count = 0; for (auto iter = list.begin(); iter != list.end(); ++iter) count++; if (count != 0) { cout << "List iteration should not produce any item" << endl; return TestFail; } /* * Set a control, and verify that the list now contains it, and * nothing else. */ list.set(controls::Brightness, 255); if (list.empty()) { cout << "List should not be empty" << endl; return TestFail; } if (list.size() != 1) { cout << "List should contain one item" << endl; return TestFail; } if (!list.contains(controls::Brightness)) { cout << "List should contain Brightness control" << endl; return TestFail; } count = 0; for (auto iter = list.begin(); iter != list.end(); ++iter) count++; if (count != 1) { cout << "List iteration should produce one item" << endl; return TestFail; } if (list.get(controls::Brightness) != 255) { cout << "Incorrest Brightness control value" << endl; return TestFail; } if (list.contains(controls::Contrast)) { cout << "List should not contain Contract control" << endl; return TestFail; } /* Update the first control and set a second one. */ list.set(controls::Brightness, 64); list.set(controls::Contrast, 128); if (!list.contains(controls::Contrast) || !list.contains(controls::Contrast)) { cout << "List should contain Contrast control" << endl; return TestFail; } if (list.get(controls::Brightness) != 64 || list.get(controls::Contrast) != 128) { cout << "Failed to retrieve control value" << endl; return TestFail; } /* * Update both controls and verify that the container doesn't * grow. */ list.set(controls::Brightness, 10); list.set(controls::Contrast, 20); if (list.get(controls::Brightness) != 10 || list.get(controls::Contrast) != 20) { cout << "Failed to update control value" << endl; return TestFail; } if (list.size() != 2) { cout << "List should contain two elements" << endl; return TestFail; } /* * Attempt to set an invalid control and verify that the * operation failed. */ list.set(controls::AwbEnable, true); if (list.contains(controls::AwbEnable)) { cout << "List shouldn't contain AwbEnable control" << endl; return TestFail; } return TestPass; } }; TEST_REGISTER(ControlListTest)