Changeset 979
- Timestamp:
- Sep 25, 2011, 12:21:44 AM (11 years ago)
- Location:
- trunk/test/unit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/half.cpp
r942 r979 23 23 LOLUNIT_FIXTURE(HalfTest) 24 24 { 25 public: 26 LOLUNIT_TEST(test_half_from_float) 25 LOLUNIT_TEST(FloatToHalf) 27 26 { 28 27 for (size_t i = 0; i < sizeof(pairs) / sizeof(*pairs); i++) … … 35 34 } 36 35 37 LOLUNIT_TEST( test_half_makeaccurate)36 LOLUNIT_TEST(FloatToHalfAccurate) 38 37 { 39 38 for (size_t i = 0; i < sizeof(pairs) / sizeof(*pairs); i++) … … 46 45 } 47 46 48 LOLUNIT_TEST( test_half_makebits)47 LOLUNIT_TEST(BitsToHalf) 49 48 { 50 49 for (unsigned int i = 0; i < 0x10000; i++) … … 57 56 } 58 57 59 LOLUNIT_TEST( test_half_is_nan)58 LOLUNIT_TEST(HalfIsNaN) 60 59 { 61 60 LOLUNIT_ASSERT(half::makebits(0x7c01).is_nan()); … … 73 72 } 74 73 75 LOLUNIT_TEST( test_half_is_inf)74 LOLUNIT_TEST(HalfIsInf) 76 75 { 77 76 LOLUNIT_ASSERT(half(65536.0f).is_inf()); … … 90 89 } 91 90 92 LOLUNIT_TEST( test_half_is_finite)91 LOLUNIT_TEST(HalfIsFinite) 93 92 { 94 93 LOLUNIT_ASSERT(half(0.0f).is_finite()); … … 107 106 } 108 107 109 LOLUNIT_TEST( test_half_is_normal)108 LOLUNIT_TEST(HalfIsNormal) 110 109 { 111 110 LOLUNIT_ASSERT(half(0.0f).is_normal()); … … 124 123 } 125 124 126 LOLUNIT_TEST( test_half_classify)125 LOLUNIT_TEST(HalfClassify) 127 126 { 128 127 for (uint32_t i = 0; i < 0x10000; i++) … … 148 147 } 149 148 150 LOLUNIT_TEST( test_half_to_float)149 LOLUNIT_TEST(HalfToFloat) 151 150 { 152 151 for (size_t i = 0; i < sizeof(pairs) / sizeof(*pairs); i++) … … 177 176 } 178 177 179 LOLUNIT_TEST( test_half_to_int)178 LOLUNIT_TEST(HalfToInt) 180 179 { 181 180 LOLUNIT_ASSERT_EQUAL((int)(half)(0.0f), 0); … … 191 190 } 192 191 193 LOLUNIT_TEST( test_float_op_half)192 LOLUNIT_TEST(FloatOpHalf) 194 193 { 195 194 half zero = 0; … … 232 231 } 233 232 234 LOLUNIT_TEST( test_half_op_float)233 LOLUNIT_TEST(HalfOpFloat) 235 234 { 236 235 half zero = 0; … … 274 273 } 275 274 276 private:277 275 struct TestPair { float f; uint16_t x; }; 278 276 -
trunk/test/unit/matrix.cpp
r942 r979 21 21 LOLUNIT_FIXTURE(MatrixTest) 22 22 { 23 public:24 23 void SetUp() 25 24 { … … 37 36 void TearDown() {} 38 37 39 LOLUNIT_TEST( test_vec_eq)38 LOLUNIT_TEST(VectorEquality) 40 39 { 41 40 vec2 a2(1.0f, 2.0f); … … 85 84 } 86 85 87 LOLUNIT_TEST( test_vec_lt)86 LOLUNIT_TEST(VectorInequality) 88 87 { 89 88 vec2 a2(1.0f, 3.0f); … … 109 108 } 110 109 111 LOLUNIT_TEST( test_vec_unary)110 LOLUNIT_TEST(VectorUnaryMinus) 112 111 { 113 112 vec2 a(1.0f, 3.0f); … … 118 117 } 119 118 120 LOLUNIT_TEST( test_vec_cast)119 LOLUNIT_TEST(CastVector) 121 120 { 122 121 vec2 a1(1.0f, 3.0f); … … 138 137 } 139 138 140 LOLUNIT_TEST( test_mat_det)139 LOLUNIT_TEST(MatrixDeterminant) 141 140 { 142 141 float d1 = triangular.det(); … … 146 145 } 147 146 148 LOLUNIT_TEST( test_mat_mul)147 LOLUNIT_TEST(MatrixMultiplication) 149 148 { 150 149 mat4 m0 = identity; … … 173 172 } 174 173 175 LOLUNIT_TEST( test_mat_inv)174 LOLUNIT_TEST(MatrixInverse) 176 175 { 177 176 mat4 m0 = invertible; … … 201 200 } 202 201 203 private:204 202 mat4 triangular, identity, invertible; 205 203 }; -
trunk/test/unit/real.cpp
r976 r979 23 23 LOLUNIT_FIXTURE(RealTest) 24 24 { 25 LOLUNIT_TEST( test_real_from_float)25 LOLUNIT_TEST(FloatToReal) 26 26 { 27 27 float a1 = real(0.0f); … … 40 40 } 41 41 42 LOLUNIT_TEST( test_real_from_double)42 LOLUNIT_TEST(DoubleToReal) 43 43 { 44 44 double a1 = real(0.0); … … 57 57 } 58 58 59 LOLUNIT_TEST( test_real_neg)59 LOLUNIT_TEST(UnaryMinus) 60 60 { 61 61 float a1 = - real(1.0f); … … 70 70 } 71 71 72 LOLUNIT_TEST( test_real_comp)72 LOLUNIT_TEST(RealComparison) 73 73 { 74 74 LOLUNIT_ASSERT(real(1.0f) > real(0.5f)); … … 91 91 } 92 92 93 LOLUNIT_TEST( test_real_add)93 LOLUNIT_TEST(RealAddition) 94 94 { 95 95 float a1 = real(1.0f) + real(0.0f); … … 106 106 } 107 107 108 LOLUNIT_TEST( test_real_sub)108 LOLUNIT_TEST(RealSubtraction) 109 109 { 110 110 float a1 = real(1.0f) + real(1e20f) - real(1e20f); … … 113 113 } 114 114 115 LOLUNIT_TEST( test_real_mul)115 LOLUNIT_TEST(RealMultiplication) 116 116 { 117 117 real x(1.25f); … … 131 131 } 132 132 133 LOLUNIT_TEST( test_real_div)133 LOLUNIT_TEST(RealDivision) 134 134 { 135 135 real a1(1.0f); -
trunk/test/unit/trig.cpp
r942 r979 23 23 LOLUNIT_FIXTURE(TrigTest) 24 24 { 25 public: 26 LOLUNIT_TEST(test_sin) 25 LOLUNIT_TEST(Sin) 27 26 { 28 27 for (int i = -10000; i < 10000; i++) … … 53 52 } 54 53 55 LOLUNIT_TEST( test_cos)54 LOLUNIT_TEST(Cos) 56 55 { 57 56 for (int i = -10000; i < 10000; i++) … … 82 81 } 83 82 84 LOLUNIT_TEST( test_sincos)83 LOLUNIT_TEST(SinCos) 85 84 { 86 85 for (int i = -10000; i < 10000; i++) … … 119 118 } 120 119 121 LOLUNIT_TEST( test_tan)120 LOLUNIT_TEST(Tan) 122 121 { 123 122 for (int i = -100000; i < 100000; i++)
Note: See TracChangeset
for help on using the changeset viewer.