MCPcopy Create free account
hub / github.com/MITK/MITK / TestSetColor

Method TestSetColor

Modules/Multilabel/Testing/mitkLabelTest.cpp:114–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 void TestSetColor()
115 {
116 mitk::Label::Pointer label = mitk::Label::New();
117 mitk::Color currentColor = label->GetColor();
118 mitk::Color colorToBeCompared;
119 colorToBeCompared.Set(1., 1., 1.);
120 CPPUNIT_ASSERT_MESSAGE("Initial label has wrong color", currentColor.GetBlue() == colorToBeCompared.GetBlue());
121 CPPUNIT_ASSERT_MESSAGE("Initial label has wrong color", currentColor.GetGreen() == colorToBeCompared.GetGreen());
122 CPPUNIT_ASSERT_MESSAGE("Initial label has wrong color", currentColor.GetRed() == colorToBeCompared.GetRed());
123
124 colorToBeCompared.Set(0.4f, 0.3f, 1.0f);
125 label->SetColor(colorToBeCompared);
126 currentColor = label->GetColor();
127 CPPUNIT_ASSERT_MESSAGE("Initial label has wrong color", currentColor.GetBlue() == colorToBeCompared.GetBlue());
128 CPPUNIT_ASSERT_MESSAGE("Initial label has wrong color", currentColor.GetGreen() == colorToBeCompared.GetGreen());
129 CPPUNIT_ASSERT_MESSAGE("Initial label has wrong color", currentColor.GetRed() == colorToBeCompared.GetRed());
130 }
131
132 void TestSetValue()
133 {

Callers

nothing calls this directly

Calls 4

NewFunction · 0.50
GetColorMethod · 0.45
SetMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected