|
@@ -33,203 +33,170 @@ const float eps = 0.0001f;
|
|
|
#define CIV4(a, b, c, d) (&(IV4){a, b, c, d})
|
|
|
#define CIV40 CIV4(0, 0, 0, 0)
|
|
|
|
|
|
-static void testV(const char* file, int line, const float* wanted,
|
|
|
- const float* actual, size_t n) {
|
|
|
- for(size_t i = 0; i < n; i++) {
|
|
|
- coreTestFloat(file, line, wanted[i], actual[i], eps);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-#define testV2(wanted, actual) \
|
|
|
- testV(__FILE__, __LINE__, (wanted)->data, (actual)->data, 2)
|
|
|
-#define testV3(wanted, actual) \
|
|
|
- testV(__FILE__, __LINE__, (wanted)->data, (actual)->data, 3)
|
|
|
-#define testV4(wanted, actual) \
|
|
|
- testV(__FILE__, __LINE__, (wanted)->data, (actual)->data, 4)
|
|
|
-
|
|
|
-static void testIV(const char* file, int line, const int* wanted,
|
|
|
- const int* actual, size_t n) {
|
|
|
- for(size_t i = 0; i < n; i++) {
|
|
|
- coreTestInt(file, line, wanted[i], actual[i]);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-#define testIV2(wanted, actual) \
|
|
|
- testIV(__FILE__, __LINE__, (wanted)->data, (actual)->data, 2)
|
|
|
-#define testIV3(wanted, actual) \
|
|
|
- testIV(__FILE__, __LINE__, (wanted)->data, (actual)->data, 3)
|
|
|
-#define testIV4(wanted, actual) \
|
|
|
- testIV(__FILE__, __LINE__, (wanted)->data, (actual)->data, 4)
|
|
|
+#define TESTS X(V2) X(V3) X(V4) X(IV2) X(IV3) X(IV4)
|
|
|
|
|
|
static void testSetAngles() {
|
|
|
float root = sqrtf(2) * 0.5f;
|
|
|
- testV3(FV3(1, 0, 0), coreAngles(CV30, 0, 0));
|
|
|
- testV3(FV3(root, 0, -root), coreAngles(CV30, 45, 0));
|
|
|
- testV3(FV3(0, 0, -1), coreAngles(CV30, 90, 0));
|
|
|
- testV3(FV3(-root, 0, -root), coreAngles(CV30, 135, 0));
|
|
|
- testV3(FV3(-1, 0, 0), coreAngles(CV30, 180, 0));
|
|
|
- testV3(FV3(-root, 0, root), coreAngles(CV30, 225, 0));
|
|
|
- testV3(FV3(0, 0, 1), coreAngles(CV30, 270, 0));
|
|
|
- testV3(FV3(root, 0, root), coreAngles(CV30, 315, 0));
|
|
|
-
|
|
|
- testV3(FV3(0, 1, 0), coreAngles(CV30, 0, 90));
|
|
|
- testV3(FV3(0, 1, 0), coreAngles(CV30, 90, 90));
|
|
|
- testV3(FV3(0, 1, 0), coreAngles(CV30, 180, 90));
|
|
|
- testV3(FV3(0, 1, 0), coreAngles(CV30, 270, 90));
|
|
|
-
|
|
|
- testV3(FV3(0, -1, 0), coreAngles(CV30, 0, -90));
|
|
|
- testV3(FV3(0, -1, 0), coreAngles(CV30, 90, -90));
|
|
|
- testV3(FV3(0, -1, 0), coreAngles(CV30, 180, -90));
|
|
|
- testV3(FV3(0, -1, 0), coreAngles(CV30, 270, -90));
|
|
|
-
|
|
|
- testV3(FV3(root, root, 0), coreAngles(CV30, 0, 45));
|
|
|
- testV3(FV3(0, root, -root), coreAngles(CV30, 90, 45));
|
|
|
- testV3(FV3(-root, root, 0), coreAngles(CV30, 180, 45));
|
|
|
- testV3(FV3(0, root, root), coreAngles(CV30, 270, 45));
|
|
|
-
|
|
|
- testV3(FV3(root, -root, 0), coreAngles(CV30, 0, -45));
|
|
|
- testV3(FV3(0, -root, -root), coreAngles(CV30, 90, -45));
|
|
|
- testV3(FV3(-root, -root, 0), coreAngles(CV30, 180, -45));
|
|
|
- testV3(FV3(0, -root, root), coreAngles(CV30, 270, -45));
|
|
|
-
|
|
|
- testV3(FV3(0.5f, root, -0.5f), coreAngles(CV30, 45, 45));
|
|
|
+ CORE_TEST_V3(FV3(1, 0, 0), coreAngles(CV30, 0, 0));
|
|
|
+ CORE_TEST_V3(FV3(root, 0, -root), coreAngles(CV30, 45, 0));
|
|
|
+ CORE_TEST_V3(FV3(0, 0, -1), coreAngles(CV30, 90, 0));
|
|
|
+ CORE_TEST_V3(FV3(-root, 0, -root), coreAngles(CV30, 135, 0));
|
|
|
+ CORE_TEST_V3(FV3(-1, 0, 0), coreAngles(CV30, 180, 0));
|
|
|
+ CORE_TEST_V3(FV3(-root, 0, root), coreAngles(CV30, 225, 0));
|
|
|
+ CORE_TEST_V3(FV3(0, 0, 1), coreAngles(CV30, 270, 0));
|
|
|
+ CORE_TEST_V3(FV3(root, 0, root), coreAngles(CV30, 315, 0));
|
|
|
+
|
|
|
+ CORE_TEST_V3(FV3(0, 1, 0), coreAngles(CV30, 0, 90));
|
|
|
+ CORE_TEST_V3(FV3(0, 1, 0), coreAngles(CV30, 90, 90));
|
|
|
+ CORE_TEST_V3(FV3(0, 1, 0), coreAngles(CV30, 180, 90));
|
|
|
+ CORE_TEST_V3(FV3(0, 1, 0), coreAngles(CV30, 270, 90));
|
|
|
+
|
|
|
+ CORE_TEST_V3(FV3(0, -1, 0), coreAngles(CV30, 0, -90));
|
|
|
+ CORE_TEST_V3(FV3(0, -1, 0), coreAngles(CV30, 90, -90));
|
|
|
+ CORE_TEST_V3(FV3(0, -1, 0), coreAngles(CV30, 180, -90));
|
|
|
+ CORE_TEST_V3(FV3(0, -1, 0), coreAngles(CV30, 270, -90));
|
|
|
+
|
|
|
+ CORE_TEST_V3(FV3(root, root, 0), coreAngles(CV30, 0, 45));
|
|
|
+ CORE_TEST_V3(FV3(0, root, -root), coreAngles(CV30, 90, 45));
|
|
|
+ CORE_TEST_V3(FV3(-root, root, 0), coreAngles(CV30, 180, 45));
|
|
|
+ CORE_TEST_V3(FV3(0, root, root), coreAngles(CV30, 270, 45));
|
|
|
+
|
|
|
+ CORE_TEST_V3(FV3(root, -root, 0), coreAngles(CV30, 0, -45));
|
|
|
+ CORE_TEST_V3(FV3(0, -root, -root), coreAngles(CV30, 90, -45));
|
|
|
+ CORE_TEST_V3(FV3(-root, -root, 0), coreAngles(CV30, 180, -45));
|
|
|
+ CORE_TEST_V3(FV3(0, -root, root), coreAngles(CV30, 270, -45));
|
|
|
+
|
|
|
+ CORE_TEST_V3(FV3(0.5f, root, -0.5f), coreAngles(CV30, 45, 45));
|
|
|
}
|
|
|
|
|
|
static void testCross() {
|
|
|
- testV3(FV3(0, 0, 1), coreCross(CV30, FV3(1, 0, 0), FV3(0, 1, 0)));
|
|
|
- testV3(FV3(0, -1, 0), coreCross(CV30, FV3(1, 0, 0), FV3(0, 0, 1)));
|
|
|
- testV3(FV3(0, 0, -1), coreCross(CV30, FV3(0, 1, 0), FV3(1, 0, 0)));
|
|
|
- testV3(FV3(1, 0, 0), coreCross(CV30, FV3(0, 1, 0), FV3(0, 0, 1)));
|
|
|
- testV3(FV3(0, 1, 0), coreCross(CV30, FV3(0, 0, 1), FV3(1, 0, 0)));
|
|
|
- testV3(FV3(-1, 0, 0), coreCross(CV30, FV3(0, 0, 1), FV3(0, 1, 0)));
|
|
|
+ CORE_TEST_V3(FV3(0, 0, 1), coreCross(CV30, FV3(1, 0, 0), FV3(0, 1, 0)));
|
|
|
+ CORE_TEST_V3(FV3(0, -1, 0), coreCross(CV30, FV3(1, 0, 0), FV3(0, 0, 1)));
|
|
|
+ CORE_TEST_V3(FV3(0, 0, -1), coreCross(CV30, FV3(0, 1, 0), FV3(1, 0, 0)));
|
|
|
+ CORE_TEST_V3(FV3(1, 0, 0), coreCross(CV30, FV3(0, 1, 0), FV3(0, 0, 1)));
|
|
|
+ CORE_TEST_V3(FV3(0, 1, 0), coreCross(CV30, FV3(0, 0, 1), FV3(1, 0, 0)));
|
|
|
+ CORE_TEST_V3(FV3(-1, 0, 0), coreCross(CV30, FV3(0, 0, 1), FV3(0, 1, 0)));
|
|
|
}
|
|
|
|
|
|
-#define TEST_SET_ADD(T) \
|
|
|
+static void testSetAdd() {
|
|
|
+#define X(T) \
|
|
|
{ \
|
|
|
T v = {0}; \
|
|
|
coreAddSet##T(&v, C##T(1, 2, 3, 4)); \
|
|
|
- test##T(C##T(1, 2, 3, 4), &v); \
|
|
|
+ CORE_TEST_##T(C##T(1, 2, 3, 4), &v); \
|
|
|
coreAddSet##T(&v, C##T(2, 3, 4, 5)); \
|
|
|
- test##T(C##T(3, 5, 7, 9), &v); \
|
|
|
+ CORE_TEST_##T(C##T(3, 5, 7, 9), &v); \
|
|
|
}
|
|
|
-
|
|
|
-static void testSetAdd() {
|
|
|
- TEST_SET_ADD(V2)
|
|
|
- TEST_SET_ADD(V3)
|
|
|
- TEST_SET_ADD(V4)
|
|
|
+ TESTS
|
|
|
+#undef X
|
|
|
}
|
|
|
|
|
|
static void testAdd() {
|
|
|
- testV3(FV3(1, 2, 3), coreAddV3(CV30, CV30, FV3(1, 2, 3)));
|
|
|
- testV3(FV3(3, 5, 7), coreAddV3(CV30, FV3(1, 2, 3), FV3(2, 3, 4)));
|
|
|
+ CORE_TEST_V3(FV3(1, 2, 3), coreAddV3(CV30, CV30, FV3(1, 2, 3)));
|
|
|
+ CORE_TEST_V3(FV3(3, 5, 7), coreAddV3(CV30, FV3(1, 2, 3), FV3(2, 3, 4)));
|
|
|
}
|
|
|
|
|
|
-#define TEST_SET_SUB(T) \
|
|
|
+static void testSetSub() {
|
|
|
+#define X(T) \
|
|
|
{ \
|
|
|
T v = {0}; \
|
|
|
coreSubSet##T(&v, C##T(1, 2, 3, 4)); \
|
|
|
- test##T(C##T(-1, -2, -3, -4), &v); \
|
|
|
+ CORE_TEST_##T(C##T(-1, -2, -3, -4), &v); \
|
|
|
coreSubSet##T(&v, C##T(2, 3, 4, 5)); \
|
|
|
- test##T(C##T(-3, -5, -7, -9), &v); \
|
|
|
+ CORE_TEST_##T(C##T(-3, -5, -7, -9), &v); \
|
|
|
}
|
|
|
-
|
|
|
-static void testSetSub() {
|
|
|
- TEST_SET_SUB(V2)
|
|
|
- TEST_SET_SUB(V3)
|
|
|
- TEST_SET_SUB(V4)
|
|
|
+ TESTS
|
|
|
+#undef X
|
|
|
}
|
|
|
|
|
|
static void testSub() {
|
|
|
- testV3(FV3(1, 2, 3), coreSubV3(CV30, CV30, FV3(-1, -2, -3)));
|
|
|
- testV3(FV3(-1, -1, -1), coreSubV3(CV30, FV3(1, 2, 3), FV3(2, 3, 4)));
|
|
|
+ CORE_TEST_V3(FV3(1, 2, 3), coreSubV3(CV30, CV30, FV3(-1, -2, -3)));
|
|
|
+ CORE_TEST_V3(FV3(-1, -1, -1), coreSubV3(CV30, FV3(1, 2, 3), FV3(2, 3, 4)));
|
|
|
}
|
|
|
|
|
|
-#define TEST_SET_MUL(T) \
|
|
|
+static void testSetMul() {
|
|
|
+#define X(T) \
|
|
|
{ \
|
|
|
T v = *C##T(1, 2, 3, 4); \
|
|
|
coreMulSet##T##F(&v, 3); \
|
|
|
- test##T(C##T(3, 6, 9, 12), &v); \
|
|
|
+ CORE_TEST_##T(C##T(3, 6, 9, 12), &v); \
|
|
|
coreMulSet##T##F(&v, -2); \
|
|
|
- test##T(C##T(-6, -12, -18, -24), &v); \
|
|
|
+ CORE_TEST_##T(C##T(-6, -12, -18, -24), &v); \
|
|
|
}
|
|
|
-
|
|
|
-static void testSetMul() {
|
|
|
- TEST_SET_MUL(V2)
|
|
|
- TEST_SET_MUL(V3)
|
|
|
- TEST_SET_MUL(V4)
|
|
|
+ TESTS
|
|
|
+#undef X
|
|
|
}
|
|
|
|
|
|
static void testMul() {
|
|
|
- testV3(FV3(3, 6, 9), coreMulV3F(CV30, FV3(1, 2, 3), 3));
|
|
|
+ CORE_TEST_V3(FV3(3, 6, 9), coreMulV3F(CV30, FV3(1, 2, 3), 3));
|
|
|
}
|
|
|
|
|
|
-#define TEST_SET_MUL_VECTOR(T) \
|
|
|
+static void testSetMulVector() {
|
|
|
+#define X(T) \
|
|
|
{ \
|
|
|
T v = *C##T(1, 2, 3, 4); \
|
|
|
coreMulSet##T(&v, C##T(2, 1, 3, 4)); \
|
|
|
- test##T(C##T(2, 2, 9, 16), &v); \
|
|
|
+ CORE_TEST_##T(C##T(2, 2, 9, 16), &v); \
|
|
|
coreMulSet##T(&v, C##T(-3, 4, -2, -2)); \
|
|
|
- test##T(C##T(-6, 8, -18, -32), &v); \
|
|
|
+ CORE_TEST_##T(C##T(-6, 8, -18, -32), &v); \
|
|
|
}
|
|
|
-
|
|
|
-static void testSetMulVector() {
|
|
|
- TEST_SET_MUL_VECTOR(V2)
|
|
|
- TEST_SET_MUL_VECTOR(V3)
|
|
|
- TEST_SET_MUL_VECTOR(V4)
|
|
|
+ TESTS
|
|
|
+#undef X
|
|
|
}
|
|
|
|
|
|
static void testMulVector() {
|
|
|
- testV3(FV3(-2, -2, -9), coreMulV3(CV30, FV3(2, 1, 3), FV3(-1, -2, -3)));
|
|
|
- testV3(FV3(2, 2, 9), coreMulV3(CV30, FV3(1, 2, 3), FV3(2, 1, 3)));
|
|
|
+ CORE_TEST_V3(FV3(-2, -2, -9),
|
|
|
+ coreMulV3(CV30, FV3(2, 1, 3), FV3(-1, -2, -3)));
|
|
|
+ CORE_TEST_V3(FV3(2, 2, 9), coreMulV3(CV30, FV3(1, 2, 3), FV3(2, 1, 3)));
|
|
|
}
|
|
|
|
|
|
-#define TEST_SET_DIV(T) \
|
|
|
+static void testSetDiv() {
|
|
|
+#define X(T) \
|
|
|
{ \
|
|
|
- T v = *C##T(12, 24, 9, 27); \
|
|
|
+ T v = *C##T(18, 36, 9, 27); \
|
|
|
coreDivSet##T##F(&v, 3); \
|
|
|
- test##T(C##T(4, 8, 3, 9), &v); \
|
|
|
- coreDivSet##T##F(&v, -2); \
|
|
|
- test##T(C##T(-2, -4, -1.5f, -4.5f), &v); \
|
|
|
+ CORE_TEST_##T(C##T(6, 12, 3, 9), &v); \
|
|
|
+ coreDivSet##T##F(&v, -3); \
|
|
|
+ CORE_TEST_##T(C##T(-2, -4, -1, -3), &v); \
|
|
|
}
|
|
|
-
|
|
|
-static void testSetDiv() {
|
|
|
- TEST_SET_DIV(V2);
|
|
|
- TEST_SET_DIV(V3);
|
|
|
- TEST_SET_DIV(V4);
|
|
|
+ TESTS
|
|
|
+#undef X
|
|
|
}
|
|
|
|
|
|
static void testDiv() {
|
|
|
- testV3(FV3(-1, -2, -3), coreDivV3F(CV30, FV3(-3, -6, -9), 3));
|
|
|
+ CORE_TEST_V3(FV3(-1, -2, -3), coreDivV3F(CV30, FV3(-3, -6, -9), 3));
|
|
|
}
|
|
|
|
|
|
-#define TEST_SET_DIV_VECTOR(T) \
|
|
|
+static void testSetDivVector() {
|
|
|
+#define X(T) \
|
|
|
{ \
|
|
|
- T v = *C##T(3, 4, 6, 8); \
|
|
|
+ T v = *C##T(12, 4, 6, 8); \
|
|
|
coreDivSet##T(&v, C##T(2, 1, 3, 4)); \
|
|
|
- test##T(C##T(1.5f, 4, 2, 2), &v); \
|
|
|
+ CORE_TEST_##T(C##T(6, 4, 2, 2), &v); \
|
|
|
coreDivSet##T(&v, C##T(-3, 4, -2, -1)); \
|
|
|
- test##T(C##T(-0.5f, 1, -1, -2), &v); \
|
|
|
+ CORE_TEST_##T(C##T(-2, 1, -1, -2), &v); \
|
|
|
}
|
|
|
-
|
|
|
-static void testSetDivVector() {
|
|
|
- TEST_SET_DIV_VECTOR(V2)
|
|
|
- TEST_SET_DIV_VECTOR(V3)
|
|
|
- TEST_SET_DIV_VECTOR(V4)
|
|
|
+ TESTS
|
|
|
+#undef X
|
|
|
}
|
|
|
|
|
|
static void testDivVector() {
|
|
|
- testV3(FV3(-2, -0.5f, -1), coreDivV3(CV30, FV3(2, 1, 3), FV3(-1, -2, -3)));
|
|
|
- testV3(FV3(0.5f, 2, 1), coreDivV3(CV30, FV3(1, 2, 3), FV3(2, 1, 3)));
|
|
|
+ CORE_TEST_V3(FV3(-2, -0.5f, -1),
|
|
|
+ coreDivV3(CV30, FV3(2, 1, 3), FV3(-1, -2, -3)));
|
|
|
+ CORE_TEST_V3(FV3(0.5f, 2, 1), coreDivV3(CV30, FV3(1, 2, 3), FV3(2, 1, 3)));
|
|
|
}
|
|
|
|
|
|
static void testSetInvert() {
|
|
|
- testV2(FV2(-1, 2), coreInvertSetV2(FV2(1, -2)));
|
|
|
- testV3(FV3(-1, 2, 3), coreInvertSetV3(FV3(1, -2, -3)));
|
|
|
- testV4(CV4(-1, 2, 3, 4), coreInvertSetV4(CV4(1, -2, -3, -4)));
|
|
|
+ CORE_TEST_V2(FV2(-1, 2), coreInvertSetV2(FV2(1, -2)));
|
|
|
+ CORE_TEST_V3(FV3(-1, 2, 3), coreInvertSetV3(FV3(1, -2, -3)));
|
|
|
+ CORE_TEST_V4(CV4(-1, 2, 3, 4), coreInvertSetV4(CV4(1, -2, -3, -4)));
|
|
|
+ CORE_TEST_IV2(FIV2(-1, 2), coreInvertSetIV2(FIV2(1, -2)));
|
|
|
+ CORE_TEST_IV3(FIV3(-1, 2, 3), coreInvertSetIV3(FIV3(1, -2, -3)));
|
|
|
+ CORE_TEST_IV4(CIV4(-1, 2, 3, 4), coreInvertSetIV4(CIV4(1, -2, -3, -4)));
|
|
|
}
|
|
|
|
|
|
static void testInvert() {
|
|
|
- testV3(FV3(-1, 2, 3), coreInvertV3(CV30, FV3(1, -2, -3)));
|
|
|
+ CORE_TEST_V3(FV3(-1, 2, 3), coreInvertV3(CV30, FV3(1, -2, -3)));
|
|
|
}
|
|
|
|
|
|
static void testDot() {
|
|
@@ -259,51 +226,51 @@ static void testNormalize() {
|
|
|
V2 v2;
|
|
|
coreMulV2F(&v2, &v1, 1.0f / 25.0f);
|
|
|
coreNormalizeV2(&v1);
|
|
|
- testV2(&v2, &v1);
|
|
|
+ CORE_TEST_V2(&v2, &v1);
|
|
|
|
|
|
V2 v3 = {15, 36};
|
|
|
V2 v4;
|
|
|
coreMulV2F(&v4, &v3, 1.0f / 39.0f);
|
|
|
coreNormalizeV2(&v3);
|
|
|
- testV2(&v4, &v3);
|
|
|
+ CORE_TEST_V2(&v4, &v3);
|
|
|
}
|
|
|
{
|
|
|
V3 v1 = {-2, 2, -1};
|
|
|
V3 v2;
|
|
|
coreMulV3F(&v2, &v1, 1.0f / 3.0f);
|
|
|
coreNormalizeV3(&v1);
|
|
|
- testV3(&v2, &v1);
|
|
|
+ CORE_TEST_V3(&v2, &v1);
|
|
|
|
|
|
V3 v3 = {6, 2, -3};
|
|
|
V3 v4;
|
|
|
coreMulV3F(&v4, &v3, 1.0f / 7.0f);
|
|
|
coreNormalizeV3(&v3);
|
|
|
- testV3(&v4, &v3);
|
|
|
+ CORE_TEST_V3(&v4, &v3);
|
|
|
}
|
|
|
{
|
|
|
V4 v1 = {-2, 2, 0, -1};
|
|
|
V4 v2;
|
|
|
coreMulV4F(&v2, &v1, 1.0f / 3.0f);
|
|
|
coreNormalizeV4(&v1);
|
|
|
- testV4(&v2, &v1);
|
|
|
+ CORE_TEST_V4(&v2, &v1);
|
|
|
|
|
|
V4 v3 = {6, 0, -6, 3};
|
|
|
V4 v4;
|
|
|
coreMulV4F(&v4, &v3, 1.0f / 9.0f);
|
|
|
coreNormalizeV4(&v3);
|
|
|
- testV4(&v4, &v3);
|
|
|
+ CORE_TEST_V4(&v4, &v3);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static void testCast() {
|
|
|
- testV2(FV2(-2.0f, 2.0f), coreConvertIV2(CV20, FIV2(-2, 2)));
|
|
|
- testIV2(FIV2(-2, 2), coreConvertV2(CIV20, FV2(-2.5f, 2.6f)));
|
|
|
- testV3(FV3(-2.0f, 2.0f, 9.0f), coreConvertIV3(CV30, FIV3(-2, 2, 9)));
|
|
|
- testIV3(FIV3(-2, 2, 9), coreConvertV3(CIV30, FV3(-2.5f, 2.6f, 9.0f)));
|
|
|
- testV4(CV4(-2.0f, 2.0f, 9.0f, 6.0f),
|
|
|
- coreConvertIV4(CV40, CIV4(-2, 2, 9, 6)));
|
|
|
- testIV4(CIV4(-2, 2, 9, 3),
|
|
|
- coreConvertV4(CIV40, CV4(-2.5f, 2.6f, 9.0f, 3.2f)));
|
|
|
+ CORE_TEST_V2(FV2(-2.0f, 2.0f), coreConvertIV2(CV20, FIV2(-2, 2)));
|
|
|
+ CORE_TEST_IV2(FIV2(-2, 2), coreConvertV2(CIV20, FV2(-2.5f, 2.6f)));
|
|
|
+ CORE_TEST_V3(FV3(-2.0f, 2.0f, 9.0f), coreConvertIV3(CV30, FIV3(-2, 2, 9)));
|
|
|
+ CORE_TEST_IV3(FIV3(-2, 2, 9), coreConvertV3(CIV30, FV3(-2.5f, 2.6f, 9.0f)));
|
|
|
+ CORE_TEST_V4(CV4(-2.0f, 2.0f, 9.0f, 6.0f),
|
|
|
+ coreConvertIV4(CV40, CIV4(-2, 2, 9, 6)));
|
|
|
+ CORE_TEST_IV4(CIV4(-2, 2, 9, 3),
|
|
|
+ coreConvertV4(CIV40, CV4(-2.5f, 2.6f, 9.0f, 3.2f)));
|
|
|
}
|
|
|
|
|
|
static void testToString() {
|
|
@@ -314,6 +281,12 @@ static void testToString() {
|
|
|
CORE_TEST_STRING("[4.000, 5.000, 6.000]", buffer);
|
|
|
coreToStringV4(CV4(4, 5, 6, 7), buffer, sizeof(buffer));
|
|
|
CORE_TEST_STRING("[4.000, 5.000, 6.000, 7.000]", buffer);
|
|
|
+ coreToStringIV2(FIV2(4, 5), buffer, sizeof(buffer));
|
|
|
+ CORE_TEST_STRING("[4, 5]", buffer);
|
|
|
+ coreToStringIV3(FIV3(4, 5, 6), buffer, sizeof(buffer));
|
|
|
+ CORE_TEST_STRING("[4, 5, 6]", buffer);
|
|
|
+ coreToStringIV4(CIV4(4, 5, 6, 7), buffer, sizeof(buffer));
|
|
|
+ CORE_TEST_STRING("[4, 5, 6, 7]", buffer);
|
|
|
}
|
|
|
|
|
|
void coreTestVector() {
|