From 65815b6d3a67cf07a01f28fb9ecb7bf05049754b Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 23 Oct 2018 10:54:02 -0700 Subject: ui: Add constness to Draw- functions. These functions take the given GRSurface instances as inputs, which shouldn't be altered. Test: mmma -j bootable/recovery Test: Run recovery_unit_test. Test: `Run graphics test` on marlin. Change-Id: I51bf408e85faae2b497d4f148ab1dec22dd16c93 --- tests/unit/screen_ui_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/unit/screen_ui_test.cpp') diff --git a/tests/unit/screen_ui_test.cpp b/tests/unit/screen_ui_test.cpp index ec269503e..130a6c161 100644 --- a/tests/unit/screen_ui_test.cpp +++ b/tests/unit/screen_ui_test.cpp @@ -42,26 +42,26 @@ static const std::vector ITEMS{ "item1", "item2", "item3", "item4", class MockDrawFunctions : public DrawInterface { void SetColor(UIElement /* element */) const override {} void DrawHighlightBar(int /* x */, int /* y */, int /* width */, - int /* height */) const override {}; + int /* height */) const override {} int DrawHorizontalRule(int /* y */) const override { return 0; - }; + } int DrawTextLine(int /* x */, int /* y */, const std::string& /* line */, bool /* bold */) const override { return 0; - }; - void DrawSurface(GRSurface* /* surface */, int /* sx */, int /* sy */, int /* w */, int /* h */, - int /* dx */, int /* dy */) const override {}; - void DrawFill(int /* x */, int /* y */, int /* w */, int /* h */) const override {}; - void DrawTextIcon(int /* x */, int /* y */, GRSurface* /* surface */) const override {}; + } + void DrawSurface(const GRSurface* /* surface */, int /* sx */, int /* sy */, int /* w */, + int /* h */, int /* dx */, int /* dy */) const override {} + void DrawFill(int /* x */, int /* y */, int /* w */, int /* h */) const override {} + void DrawTextIcon(int /* x */, int /* y */, const GRSurface* /* surface */) const override {} int DrawTextLines(int /* x */, int /* y */, const std::vector& /* lines */) const override { return 0; - }; + } int DrawWrappedTextLines(int /* x */, int /* y */, const std::vector& /* lines */) const override { return 0; - }; + } }; class ScreenUITest : public testing::Test { -- cgit v1.2.3