From 94371fd012c661859326b73246b781ae872e0871 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 6 Jun 2018 07:38:54 -0700 Subject: ui: join only if joinable. The threads in RecoveryUI only get initialized if their Init()s finish successfully. Test: recovery_unit_test on marlin. Change-Id: Ic4b62300a3cbd47887d9f4a90dc26f8a7deab616 --- tests/unit/screen_ui_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/unit/screen_ui_test.cpp b/tests/unit/screen_ui_test.cpp index 2179b729f..a3dd2add9 100644 --- a/tests/unit/screen_ui_test.cpp +++ b/tests/unit/screen_ui_test.cpp @@ -293,6 +293,11 @@ TEST_F(ScreenRecoveryUITest, Init) { ASSERT_FALSE(ui_->WasTextEverVisible()); } +TEST_F(ScreenRecoveryUITest, dtor_NotCallingInit) { + ui_.reset(); + ASSERT_FALSE(ui_); +} + TEST_F(ScreenRecoveryUITest, ShowText) { ASSERT_TRUE(ui_->Init(kTestLocale)); ASSERT_FALSE(ui_->IsTextVisible()); -- cgit v1.2.3