Changeset 2307 for trunk/test
 Timestamp:
 Feb 1, 2013, 12:30:44 AM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/unit/color.cpp
r2218 r2307 85 85 LOLUNIT_ASSERT_DOUBLES_EQUAL(d1, d2, 0.0001); 86 86 LOLUNIT_ASSERT_DOUBLES_EQUAL(d2, d3, 0.0001); 87 LOLUNIT_UNSET_CONTEXT(); 87 88 } 88 89 } … … 95 96 { 96 97 vec3 v1 = vec3(r / 20.f, g / 20.f, b / 20.f); 97 vec3 v2 = Color::HSVToRGB(Color::RGBToHSV(v1)); 98 vec3 v2 = Color::RGBToHSV(v1); 99 vec3 v3 = Color::HSVToRGB(v2); 98 100 99 LOLUNIT_ASSERT_DOUBLES_EQUAL(v1.r, v2.r, 0.0001); 100 LOLUNIT_ASSERT_DOUBLES_EQUAL(v1.g, v2.g, 0.0001); 101 LOLUNIT_ASSERT_DOUBLES_EQUAL(v1.b, v2.b, 0.0001); 101 String rgb = String::Printf("[%f %f %f]", v1.r, v1.g, v1.b); 102 LOLUNIT_SET_CONTEXT(&rgb[0]); 103 104 if (r != g  g != b) 105 LOLUNIT_ASSERT_DOUBLES_EQUAL(v1.r, v3.r, 0.0001); 106 LOLUNIT_ASSERT_DOUBLES_EQUAL(v1.g, v3.g, 0.0001); 107 LOLUNIT_ASSERT_DOUBLES_EQUAL(v1.b, v3.b, 0.0001); 108 109 LOLUNIT_UNSET_CONTEXT(); 102 110 } 103 111 } … … 113 121 vec3 v3 = Color::HSVToHSL(Color::RGBToHSV(v1)); 114 122 115 LOLUNIT_ASSERT_DOUBLES_EQUAL(v2.x, v3.x, 0.0001); 123 String rgb = String::Printf("[%f %f %f]", v1.r, v1.g, v1.b); 124 LOLUNIT_SET_CONTEXT(&rgb[0]); 125 126 if (r != g  g != b) 127 LOLUNIT_ASSERT_DOUBLES_EQUAL(v2.x, v3.x, 0.0001); 116 128 LOLUNIT_ASSERT_DOUBLES_EQUAL(v2.y, v3.y, 0.0001); 117 129 LOLUNIT_ASSERT_DOUBLES_EQUAL(v2.z, v3.z, 0.0001); 130 131 LOLUNIT_UNSET_CONTEXT(); 118 132 } 119 133 }
Note: See TracChangeset
for help on using the changeset viewer.