Co-Simulation/Sumo/sumo-1.7.0/unittest/src/utils/common/RGBColorTest.cpp
/* Test the method 'interpolate' with a weight of 1 and higher*/
Test the method 'interpolate' with a weight of 1 and higher
Test the method ' interpolate ' with a weight of 1 and higher
TEST(RGBColor, test_interpolate_weight_1) {
    RGBColor color1 = RGBColor(1, 2, 3);
    RGBColor color2 = RGBColor(3, 4, 1);
    RGBColor colorResult = RGBColor::interpolate(color1, color2, 0.5);
    RGBColor colorResult1 = RGBColor::interpolate(color1, color2, 0);
    RGBColor colorResult2 = RGBColor::interpolate(color1, color2, 1);
    EXPECT_TRUE(color1 == colorResult1);
    EXPECT_TRUE(color2 == colorResult2);
    EXPECT_EQ(2, colorResult.red());
    EXPECT_EQ(3, colorResult.green());
    EXPECT_EQ(2, colorResult.blue());
}
TEST ( RGBColor , test_interpolate_weight_1 ) { RGBColor color1 = RGBColor ( 1 , 2 , 3 ) ; RGBColor color2 = RGBColor ( 3 , 4 , 1 ) ; RGBColor colorResult = RGBColor :: interpolate ( color1 , color2 , 0.5 ) ; RGBColor colorResult1 = RGBColor :: interpolate ( color1 , color2 , 0 ) ; RGBColor colorResult2 = RGBColor :: interpolate ( color1 , color2 , 1 ) ; EXPECT_TRUE ( color1 == colorResult1 ) ; EXPECT_TRUE ( color2 == colorResult2 ) ; EXPECT_EQ ( 2 , colorResult . red ( ) ) ; EXPECT_EQ ( 3 , colorResult . green ( ) ) ; EXPECT_EQ ( 2 , colorResult . blue ( ) ) ; }
Test the method 'interpolate' with a weight of 1 and higher
Test the method ' interpolate ' with a weight of 1 and higher