TEST(ConfigTest, ScreenIsWideGamut) { ResTable_config defaultConfig; memset(&defaultConfig, 0, sizeof(defaultConfig)); ResTable_config wideGamutConfig = defaultConfig; wideGamutConfig.colorMode = ResTable_config::WIDE_COLOR_GAMUT_YES; EXPECT_EQ(defaultConfig.diff(wideGamutConfig), ResTable_config::CONFIG_COLOR_MODE); }
TEST(ConfigTest, ScreenIsHdr) { ResTable_config defaultConfig; memset(&defaultConfig, 0, sizeof(defaultConfig)); ResTable_config hdrConfig = defaultConfig; hdrConfig.colorMode = ResTable_config::HDR_YES; EXPECT_EQ(defaultConfig.diff(hdrConfig), ResTable_config::CONFIG_COLOR_MODE); }
TEST(ConfigTest, ScreenShapeHasCorrectDiff) { ResTable_config defaultConfig; memset(&defaultConfig, 0, sizeof(defaultConfig)); ResTable_config roundConfig = defaultConfig; roundConfig.screenLayout2 = ResTable_config::SCREENROUND_YES; EXPECT_EQ(defaultConfig.diff(roundConfig), ResTable_config::CONFIG_SCREEN_ROUND); }
bool isSameExcept(const ResTable_config& a, const ResTable_config& b, int axisMask) { return a.diff(b) == axisMask; }