Closed kskels closed 13 years ago
I think we should probably split the unit test into two unit tests, one for vectors and one for matrices. Or maybe this way is good. The rounding stuff, if GTest doesn't have built-in support for comparing floats, then we should just check if the difference between the two values is lower than a certain threshold. An epsilon value. http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
And of course you are right, GTest has inbuilt support for floats!
EXPECT_FLOAT_EQ(expected, actual); // the two float values are almost equal
By "almost equal", we mean the two values are within 4 ULP's from each other.
Added some unit test for vec2. I know it's kind a simple but still I had some questions there. I you have time please take a look in ~src/math/unittest/math_unittest.cpp. There are couple of questions.