소스 검색

test: improve matrix and vector uni tests.

legacy
Sam Hocevar sam 13 년 전
부모
커밋
00b8d5c28d
1개의 변경된 파일42개의 추가작업 그리고 42개의 파일을 삭제
  1. +42
    -42
      test/matrix.cpp

+ 42
- 42
test/matrix.cpp 파일 보기

@@ -42,28 +42,28 @@ public:
vec2 b2(0.0f, 2.0f); vec2 b2(0.0f, 2.0f);
vec2 c2(1.0f, 0.0f); vec2 c2(1.0f, 0.0f);


LOLUNIT_ASSERT(a2 == a2);
LOLUNIT_ASSERT(!(a2 != a2));
LOLUNIT_ASSERT_EQUAL(a2, a2);
LOLUNIT_ASSERT_NOT_DIFFERENT(a2, a2);


LOLUNIT_ASSERT(a2 != b2);
LOLUNIT_ASSERT(!(a2 == b2));
LOLUNIT_ASSERT(a2 != c2);
LOLUNIT_ASSERT(!(a2 == c2));
LOLUNIT_ASSERT_DIFFERENT(a2, b2);
LOLUNIT_ASSERT_NOT_EQUAL(a2, b2);
LOLUNIT_ASSERT_DIFFERENT(a2, c2);
LOLUNIT_ASSERT_NOT_EQUAL(a2, c2);


vec3 a3(1.0f, 2.0f, 3.0f); vec3 a3(1.0f, 2.0f, 3.0f);
vec3 b3(0.0f, 2.0f, 3.0f); vec3 b3(0.0f, 2.0f, 3.0f);
vec3 c3(1.0f, 0.0f, 3.0f); vec3 c3(1.0f, 0.0f, 3.0f);
vec3 d3(1.0f, 2.0f, 0.0f); vec3 d3(1.0f, 2.0f, 0.0f);


LOLUNIT_ASSERT(a3 == a3);
LOLUNIT_ASSERT(!(a3 != a3));
LOLUNIT_ASSERT_EQUAL(a3, a3);
LOLUNIT_ASSERT_NOT_DIFFERENT(a3, a3);


LOLUNIT_ASSERT(a3 != b3);
LOLUNIT_ASSERT(!(a3 == b3));
LOLUNIT_ASSERT(a3 != c3);
LOLUNIT_ASSERT(!(a3 == c3));
LOLUNIT_ASSERT(a3 != d3);
LOLUNIT_ASSERT(!(a3 == d3));
LOLUNIT_ASSERT_DIFFERENT(a3, b3);
LOLUNIT_ASSERT_NOT_EQUAL(a3, b3);
LOLUNIT_ASSERT_DIFFERENT(a3, c3);
LOLUNIT_ASSERT_NOT_EQUAL(a3, c3);
LOLUNIT_ASSERT_DIFFERENT(a3, d3);
LOLUNIT_ASSERT_NOT_EQUAL(a3, d3);


vec4 a4(1.0f, 2.0f, 3.0f, 4.0f); vec4 a4(1.0f, 2.0f, 3.0f, 4.0f);
vec4 b4(0.0f, 2.0f, 3.0f, 4.0f); vec4 b4(0.0f, 2.0f, 3.0f, 4.0f);
@@ -71,17 +71,17 @@ public:
vec4 d4(1.0f, 2.0f, 0.0f, 4.0f); vec4 d4(1.0f, 2.0f, 0.0f, 4.0f);
vec4 e4(1.0f, 2.0f, 3.0f, 0.0f); vec4 e4(1.0f, 2.0f, 3.0f, 0.0f);


LOLUNIT_ASSERT(a4 == a4);
LOLUNIT_ASSERT(!(a4 != a4));
LOLUNIT_ASSERT(a4 != b4);
LOLUNIT_ASSERT(!(a4 == b4));
LOLUNIT_ASSERT(a4 != c4);
LOLUNIT_ASSERT(!(a4 == c4));
LOLUNIT_ASSERT(a4 != d4);
LOLUNIT_ASSERT(!(a4 == d4));
LOLUNIT_ASSERT(a4 != e4);
LOLUNIT_ASSERT(!(a4 == e4));
LOLUNIT_ASSERT_EQUAL(a4, a4);
LOLUNIT_ASSERT_NOT_DIFFERENT(a4, a4);
LOLUNIT_ASSERT_DIFFERENT(a4, b4);
LOLUNIT_ASSERT_NOT_EQUAL(a4, b4);
LOLUNIT_ASSERT_DIFFERENT(a4, c4);
LOLUNIT_ASSERT_NOT_EQUAL(a4, c4);
LOLUNIT_ASSERT_DIFFERENT(a4, d4);
LOLUNIT_ASSERT_NOT_EQUAL(a4, d4);
LOLUNIT_ASSERT_DIFFERENT(a4, e4);
LOLUNIT_ASSERT_NOT_EQUAL(a4, e4);
} }


LOLUNIT_TEST(test_vec_lt) LOLUNIT_TEST(test_vec_lt)
@@ -93,19 +93,19 @@ public:
vec2 e2(3.0f, 3.0f); vec2 e2(3.0f, 3.0f);
vec2 f2(4.0f, 4.0f); vec2 f2(4.0f, 4.0f);


LOLUNIT_ASSERT(a2 <= a2);
LOLUNIT_ASSERT(!(a2 < a2));
LOLUNIT_ASSERT(!(a2 <= b2));
LOLUNIT_ASSERT(!(a2 < b2));
LOLUNIT_ASSERT(!(a2 <= c2));
LOLUNIT_ASSERT(!(a2 < c2));
LOLUNIT_ASSERT(!(a2 <= d2));
LOLUNIT_ASSERT(!(a2 < d2));
LOLUNIT_ASSERT(a2 <= e2);
LOLUNIT_ASSERT(!(a2 < e2));
LOLUNIT_ASSERT(a2 <= f2);
LOLUNIT_ASSERT(a2 < f2);
LOLUNIT_ASSERT_LEQUAL(a2, a2);
LOLUNIT_ASSERT_NOT_LESS(a2, a2);
LOLUNIT_ASSERT_NOT_LEQUAL(a2, b2);
LOLUNIT_ASSERT_NOT_LESS(a2, b2);
LOLUNIT_ASSERT_NOT_LEQUAL(a2, c2);
LOLUNIT_ASSERT_NOT_LESS(a2, c2);
LOLUNIT_ASSERT_NOT_LEQUAL(a2, d2);
LOLUNIT_ASSERT_NOT_LESS(a2, d2);
LOLUNIT_ASSERT_LEQUAL(a2, e2);
LOLUNIT_ASSERT_NOT_LESS(a2, e2);
LOLUNIT_ASSERT_LEQUAL(a2, f2);
LOLUNIT_ASSERT_LESS(a2, f2);
} }


LOLUNIT_TEST(test_vec_unary) LOLUNIT_TEST(test_vec_unary)
@@ -113,8 +113,8 @@ public:
vec2 a(1.0f, 3.0f); vec2 a(1.0f, 3.0f);
vec2 b(-1.0f, -3.0f); vec2 b(-1.0f, -3.0f);


LOLUNIT_ASSERT(a == -b);
LOLUNIT_ASSERT(-a == b);
LOLUNIT_ASSERT_EQUAL(a, -b);
LOLUNIT_ASSERT_EQUAL(-a, b);
} }


LOLUNIT_TEST(test_vec_cast) LOLUNIT_TEST(test_vec_cast)
@@ -126,7 +126,7 @@ public:
LOLUNIT_ASSERT_EQUAL(b.x, a1.x); LOLUNIT_ASSERT_EQUAL(b.x, a1.x);
LOLUNIT_ASSERT_EQUAL(b.y, a1.y); LOLUNIT_ASSERT_EQUAL(b.y, a1.y);
LOLUNIT_ASSERT_EQUAL(b.z, 0.0f); LOLUNIT_ASSERT_EQUAL(b.z, 0.0f);
LOLUNIT_ASSERT(a2 == a1);
LOLUNIT_ASSERT_EQUAL(a2, a1);


vec4 c(a1); vec4 c(a1);
vec2 a3(c); vec2 a3(c);
@@ -134,7 +134,7 @@ public:
LOLUNIT_ASSERT_EQUAL(c.y, a1.y); LOLUNIT_ASSERT_EQUAL(c.y, a1.y);
LOLUNIT_ASSERT_EQUAL(c.z, 0.0f); LOLUNIT_ASSERT_EQUAL(c.z, 0.0f);
LOLUNIT_ASSERT_EQUAL(c.w, 0.0f); LOLUNIT_ASSERT_EQUAL(c.w, 0.0f);
LOLUNIT_ASSERT(a3 == a1);
LOLUNIT_ASSERT_EQUAL(a3, a1);
} }


LOLUNIT_TEST(test_mat_det) LOLUNIT_TEST(test_mat_det)


불러오는 중...
취소
저장