summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-11-06 03:01:43 +0100
committerandroid-build-merger <android-build-merger@google.com>2018-11-06 03:01:43 +0100
commit1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5 (patch)
tree302138aef8f58cd554245b9581a506e1fef2fa2b /tests/unit
parentMerge "updater: Error out on underrun during patching." am: a0404ecd16 (diff)
parentMerge "ui: Manage loaded resources with smart pointers." (diff)
downloadandroid_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.tar
android_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.tar.gz
android_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.tar.bz2
android_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.tar.lz
android_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.tar.xz
android_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.tar.zst
android_bootable_recovery-1c1fbe032afd9acd7b9a29cfe9c99c8fe8fadec5.zip
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/screen_ui_test.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/unit/screen_ui_test.cpp b/tests/unit/screen_ui_test.cpp
index 3246e6a6e..b780af430 100644
--- a/tests/unit/screen_ui_test.cpp
+++ b/tests/unit/screen_ui_test.cpp
@@ -231,12 +231,12 @@ TEST_F(ScreenUITest, WearMenuSelectItemsOverflow) {
}
TEST_F(ScreenUITest, GraphicMenuSelection) {
- auto header = GRSurface::Create(50, 50, 50, 1, 50 * 50);
- auto item = GRSurface::Create(50, 50, 50, 1, 50 * 50);
- std::vector<GRSurface*> items = {
- item.get(),
- item.get(),
- item.get(),
+ auto image = GRSurface::Create(50, 50, 50, 1, 50 * 50);
+ auto header = image->Clone();
+ std::vector<const GRSurface*> items = {
+ image.get(),
+ image.get(),
+ image.get(),
};
GraphicMenu menu(header.get(), items, 0, draw_funcs_);
@@ -258,12 +258,12 @@ TEST_F(ScreenUITest, GraphicMenuSelection) {
}
TEST_F(ScreenUITest, GraphicMenuValidate) {
- auto header = GRSurface::Create(50, 50, 50, 1, 50 * 50);
- auto item = GRSurface::Create(50, 50, 50, 1, 50 * 50);
- std::vector<GRSurface*> items = {
- item.get(),
- item.get(),
- item.get(),
+ auto image = GRSurface::Create(50, 50, 50, 1, 50 * 50);
+ auto header = image->Clone();
+ std::vector<const GRSurface*> items = {
+ image.get(),
+ image.get(),
+ image.get(),
};
ASSERT_TRUE(GraphicMenu::Validate(200, 200, header.get(), items));
@@ -273,7 +273,7 @@ TEST_F(ScreenUITest, GraphicMenuValidate) {
ASSERT_FALSE(GraphicMenu::Validate(299, 200, wide_surface.get(), items));
// Menu exceeds the vertical boundary.
- items.push_back(item.get());
+ items.emplace_back(image.get());
ASSERT_FALSE(GraphicMenu::Validate(200, 249, header.get(), items));
}
@@ -539,8 +539,8 @@ TEST_F(ScreenRecoveryUITest, LoadAnimation) {
ui_->LoadAnimation();
- ASSERT_EQ(2u, ui_->intro_frames);
- ASSERT_EQ(3u, ui_->loop_frames);
+ ASSERT_EQ(2u, ui_->intro_frames_.size());
+ ASSERT_EQ(3u, ui_->loop_frames_.size());
for (const auto& name : tempfiles) {
ASSERT_EQ(0, unlink(name.c_str()));