0

Add death test for GetColorModelForMode()

Bug: 1069537
Change-Id: I2bafcf1a6a62a121f346255c151296dfb9ef178c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2241347
Auto-Submit: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777417}
This commit is contained in:
Daniel Hosseinian
2020-06-11 18:48:07 +00:00
committed by Commit Bot
parent 6b91b61970
commit 669080ec54

@ -14,7 +14,7 @@ TEST(PrintSettingsTest, IsColorModelSelected) {
EXPECT_TRUE(IsColorModelSelected(IsColorModelSelected(model).has_value()));
}
TEST(PrintSettingsDeathTest, IsColorModelSelectedUnknown) {
TEST(PrintSettingsDeathTest, IsColorModelSelectedEdges) {
::testing::FLAGS_gtest_death_test_style = "threadsafe";
EXPECT_DCHECK_DEATH(IsColorModelSelected(UNKNOWN_COLOR_MODEL));
EXPECT_DCHECK_DEATH(IsColorModelSelected(UNKNOWN_COLOR_MODEL - 1));
@ -33,6 +33,16 @@ TEST(PrintSettingsTest, GetColorModelForMode) {
color_value.clear();
}
}
TEST(PrintSettingsDeathTest, GetColorModelForModeEdges) {
::testing::FLAGS_gtest_death_test_style = "threadsafe";
std::string color_setting_name;
std::string color_value;
EXPECT_DCHECK_DEATH(GetColorModelForMode(UNKNOWN_COLOR_MODEL - 1,
&color_setting_name, &color_value));
EXPECT_DCHECK_DEATH(GetColorModelForMode(COLOR_MODEL_LAST + 1,
&color_setting_name, &color_value));
}
#endif // defined(USE_CUPS)
} // namespace printing