/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2010, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////// #include #include "ImathBoxAlgo.h" #include "ImathRandom.h" #include #include #include #include #include using namespace std; using namespace IMATH_INTERNAL_NAMESPACE; namespace { // // Test case generation utility - create a vector of IMATH_INTERNAL_NAMESPACE::Vec{2,3,4} // with all permutations of integers 1..T::dimensions(). // // Algorithm from www.bearcave.com/random_hacks/permute.html // template static void addItem(const std::vector &value, std::vector &perms) { T p; for (unsigned int i = 0; i < value.size(); i++) { p[i] = value[i]; } perms.push_back(p); } template static void visit(int &level, int n, int k, std::vector &value, std::vector &perms) { level = level + 1; value[k] = level; if (level == n) addItem(value, perms); else for (int i = 0; i < n; i++) if (value[i] == 0) visit(level, n, i, value, perms); level = level - 1; value[k] = 0; } template static void permutations(std::vector &perms) { std::vector value(T::dimensions()); int level = -1; int n = T::dimensions(); visit(level, n, 0, value, perms); } template static void testConstructors(const char *type) { cout << " constructors for type " << type << endl; // // Empty // { IMATH_INTERNAL_NAMESPACE::Box b; assert(b.min == T(T::baseTypeMax()) && b.max == T(T::baseTypeMin())); } // // Single point // { T p; for (unsigned int i = 0; i < T::dimensions(); i++) p[i] = i; IMATH_INTERNAL_NAMESPACE::Box b(p); assert(b.min == p && b.max == p); } // // Min and max // { T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { p0[i] = i; p1[i] = 10 * T::dimensions() - i - 1; } IMATH_INTERNAL_NAMESPACE::Box b(p0, p1); assert(b.min == p0 && b.max == p1); } } template void testMakeEmpty(const char *type) { cout << " makeEmpty() for type " << type << endl; // // Empty box // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeEmpty(); assert(b.min == T(T::baseTypeMax()) && b.max == T(T::baseTypeMin())); } // // Non-empty, has volume // { IMATH_INTERNAL_NAMESPACE::Box b(T(-1), T(1)); b.makeEmpty(); assert(b.min == T(T::baseTypeMax()) && b.max == T(T::baseTypeMin())); } // // Non-empty, no volume // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min(0); T max(0); max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b(min, max); b.makeEmpty(); assert(b.min == T(T::baseTypeMax()) && b.max == T(T::baseTypeMin())); } } template void testMakeInfinite(const char *type) { cout << " makeInfinite() for type " << type << endl; // // Infinite box // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeInfinite(); assert(b.min == T(T::baseTypeMin()) && b.max == T(T::baseTypeMax())); } // // Non-empty, has volume // { IMATH_INTERNAL_NAMESPACE::Box b(T(-1), T(1)); b.makeInfinite(); assert(b.min == T(T::baseTypeMin()) && b.max == T(T::baseTypeMax())); } // // Non-empty, no volume // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min(0); T max(0); max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b(min, max); b.makeInfinite(); assert(b.min == T(T::baseTypeMin()) && b.max == T(T::baseTypeMax())); } } template void testExtendByPoint(const char *type) { cout << " extendBy() point for type " << type << endl; IMATH_INTERNAL_NAMESPACE::Rand32 rand(0); const unsigned int iters = 10; // // Extend empty box with a single point. // for (unsigned int i = 0; i < iters; i++) { T p; for (unsigned int j = 0; j < T::dimensions(); j++) p[j] = typename T::BaseType (rand.nextf(-12345, 12345)); IMATH_INTERNAL_NAMESPACE::Box b; b.extendBy(p); assert(b.min == p && b.max == p); } // // Extend empty box with a number of random points. Note that // this also covers extending a non-empty box. // for (unsigned int i = 0; i < iters; i++) { IMATH_INTERNAL_NAMESPACE::Box b; T min; T max; for (unsigned int j = 0; j < i; j++) { T p; for (unsigned int k = 0; k < T::dimensions(); k++) p[k] = typename T::BaseType (rand.nextf(-12345, 12345)); if (j == 0) { min = p; max = p; } for (unsigned int k = 0; k < T::dimensions(); k++) { min[k] = std::min(min[k], p[k]); max[k] = std::max(max[k], p[k]); } b.extendBy(p); assert(b.min == min && b.max == max); } } } template void testExtendByBox(const char *type) { cout << " extendBy() box for type " << type << endl; // // Extend empty box with an empty box; // { IMATH_INTERNAL_NAMESPACE::Box b; b.extendBy(IMATH_INTERNAL_NAMESPACE::Box()); assert(b.min == T(T::baseTypeMax()) && b.max == T(T::baseTypeMin())); } // // Extend empty box with a non-empty box and vice versa. // { std::vector perms; permutations(perms); for (unsigned int i = 0; i < perms.size(); i++) { for (unsigned int j = 0; j < perms.size(); j++) { T p0 = -perms[i]; T p1 = perms[j]; IMATH_INTERNAL_NAMESPACE::Box b0; b0.extendBy(IMATH_INTERNAL_NAMESPACE::Box(p0, p1)); assert(b0.min == p0 && b0.max == p1); IMATH_INTERNAL_NAMESPACE::Box b1(p0, p1); b1.extendBy(IMATH_INTERNAL_NAMESPACE::Box()); assert(b1.min == p0 && b1.max == p1); } } } // // Extend non-empty box with non-empty box. Starts with empty, then builds. // IMATH_INTERNAL_NAMESPACE::Rand32 rand(0); const unsigned int iters = 10; { IMATH_INTERNAL_NAMESPACE::Box b; T min, max; for (unsigned int i = 1; i < iters; i++) { T p0; T p1; for (unsigned int k = 0; k < T::dimensions(); k++) { p0[k] = typename T::BaseType (rand.nextf( 0, 999)); p1[k] = typename T::BaseType (rand.nextf(1000, 1999)); } min = b.min; max = b.max; for (unsigned int k = 0; k < T::dimensions(); k++) { min[k] = std::min(min[k], p0[k]); max[k] = std::max(max[k], p1[k]); } b.extendBy(IMATH_INTERNAL_NAMESPACE::Box(p0, p1)); assert(b.min == min && b.max == max); } } } template void testComparators(const char *type) { cout << " comparators for type " << type << endl; IMATH_INTERNAL_NAMESPACE::Rand32 rand(0); // // Compare empty. // { IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1; assert(b0 == b1); assert(!(b0 != b1)); } // // Compare empty to non-empty. // { std::vector perms; permutations(perms); for (unsigned int i = 0; i < perms.size(); i++) { for (unsigned int j = 0; j < perms.size(); j++) { T p0 = -perms[i]; T p1 = perms[j]; IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1(p0, p1); assert(!(b0 == b1)); assert(b0 != b1); } } } // // Compare two non-empty // { std::vector perms; permutations(perms); for (unsigned int i = 0; i < perms.size(); i++) { for (unsigned int j = 0; j < perms.size(); j++) { T p0 = -perms[i]; T p1 = perms[j]; T p2 = -perms[j]; T p3 = perms[i]; IMATH_INTERNAL_NAMESPACE::Box b0(p0, p1); IMATH_INTERNAL_NAMESPACE::Box b1(p2, p3); IMATH_INTERNAL_NAMESPACE::Box b2(p0, p1); if (i == j) { assert(b0 == b1); assert(!(b0 != b1)); } else { assert(b0 != b1); assert(!(b0 == b1)); } assert(b0 == b2); assert(!(b0 != b2)); } } } } template void testIntersects(const char *type) { cout << " intersects() for type " << type << endl; IMATH_INTERNAL_NAMESPACE::Rand32 rand(0); // // Intersect point with empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; T p(1); assert(!b.intersects(p)); } // // Intersect point with non-empty, has-volume box. // { IMATH_INTERNAL_NAMESPACE::Box b(T(-1), T(1)); T p0(0); T p1(5); T p2(-5); assert(b.intersects(p0)); assert(!b.intersects(p1)); assert(!b.intersects(p2)); } // // Intersect point with non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min(0); T max = min; max[T::dimensions() - 1] = 1; T p0(0); T p1(5); IMATH_INTERNAL_NAMESPACE::Box b(min, max); assert(b.intersects(p0)); assert(!b.intersects(p1)); } // // Intersect empty box with empty box. // { IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1; assert(!b0.intersects(b1)); assert(!b1.intersects(b0)); } // // Intersect empty box with non-empty has-volume boxes. // { IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1(T(-1), T(1)); IMATH_INTERNAL_NAMESPACE::Box b2(T( 1), T(2)); assert(!b0.intersects(b1)); assert(!b0.intersects(b2)); assert(!b1.intersects(b0)); assert(!b2.intersects(b0)); } // // Intersect empty box with non-empty no-volume box. // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min(0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b0; IMATH_INTERNAL_NAMESPACE::Box b1(min, max); assert(!b0.intersects(b1)); assert(!b1.intersects(b0)); } // // Intersect non-empty has-volume box with non-empty has-volume box. // { IMATH_INTERNAL_NAMESPACE::Box b1(T(-1), T(1)); IMATH_INTERNAL_NAMESPACE::Box b2(T(-1), T(1)); IMATH_INTERNAL_NAMESPACE::Box b3(T( 1), T(2)); IMATH_INTERNAL_NAMESPACE::Box b4(T( 2), T(3)); assert(b1.intersects(b1)); assert(b1.intersects(b3)); assert(!b1.intersects(b4)); assert(b3.intersects(b1)); assert(!b4.intersects(b1)); } // // Intersect non-empty has-volume box with non-empty no-volume box. // // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { IMATH_INTERNAL_NAMESPACE::Box b0(T(-1), T(1)); T min(0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b1(min, max); IMATH_INTERNAL_NAMESPACE::Box b2(min + T(2), max + T(2)); assert(b0.intersects(b1)); assert(b1.intersects(b0)); assert(!b0.intersects(b2)); assert(!b2.intersects(b1)); } // // Intersect non-empty no-volume box with non-empty no-volume box. // // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min(0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b0(min, max); IMATH_INTERNAL_NAMESPACE::Box b1(min, max + T(2)); IMATH_INTERNAL_NAMESPACE::Box b2(min + T(2), max + T(2)); assert(b0.intersects(b1)); assert(b1.intersects(b0)); assert(!b0.intersects(b2)); assert(!b2.intersects(b0)); } } template void testSize(const char *type) { cout << " size() for type " << type << endl; // // Size of empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert(b.size() == T(0)); } // // Size of non-empty, has-volume box. // Boxes are: // 2D: [(-1, -1), (1, 1) ] // 3D: [(-1, -1, -1), (1, 1, 1) ] // 4D: [(-1, -1, -1, -1), (1, 1, 1, 1) ] // // and // // 2D: [(-1, -2), (1, 2) ] // 3D: [(-1, -2, -3), (1, 2, 3) ] // 4D: [(-1, -2, -3, -4), (1, 2, 3, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0(T(-1), T(1)); assert(b0.size() == T(2)); T p; for (unsigned int i = 0; i < T::dimensions(); i++) { p[i] = i; } IMATH_INTERNAL_NAMESPACE::Box b1(-p, p); assert(b1.size() == p * T(2)); } // // Size of non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 1) ] // 3D: [(0, 0, 0), (0, 0, 1) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 1)] // { T min(0); T max = min; max[T::dimensions() - 1] = 1; IMATH_INTERNAL_NAMESPACE::Box b(min, max); assert(b.size() == max); } } template void testCenter(const char *type) { cout << " center() for type " << type << endl; // // Center of empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert(b.center() == T(0)); } // // Center of non-empty, has-volume box. // Boxes are: // 2D: [(-1, -1), (1, 1) ] // 3D: [(-1, -1, -1), (1, 1, 1) ] // 4D: [(-1, -1, -1, -1), (1, 1, 1, 1) ] // // and // // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0(T(-1), T(1)); assert(b0.center() == T(0)); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { p0[i] = -typename T::BaseType(1 << (i + 1)); p1[i] = typename T::BaseType(1 << (T::dimensions() - i)); } IMATH_INTERNAL_NAMESPACE::Box b1(p0, p1); assert(b1.center() == (p1 + p0) / 2); } // // Center of non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min(0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b(min, max); assert(b.center() == max /2); } } template void testIsEmpty(const char *type) { cout << " isEmpty() for type " << type << endl; // // Empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert(b.isEmpty()); } // // Non-empty, has-volume box. // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0(T(-1), T(1)); assert(!b0.isEmpty()); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { p0[i] = -typename T::BaseType(1 << (i + 1)); p1[i] = typename T::BaseType(1 << (T::dimensions() - i)); } IMATH_INTERNAL_NAMESPACE::Box b1(p0, p1); assert(!b1.isEmpty()); } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min(0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b(min, max); assert(!b.isEmpty()); } } template void testIsInfinite(const char *type) { cout << " isInfinite() for type " << type << endl; // // Infinite box. // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeInfinite(); assert(b.isInfinite()); } // // Non-empty, has-volume box. // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0(T(-1), T(1)); assert(!b0.isInfinite()); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { p0[i] = -typename T::BaseType(1 << (i + 1)); p1[i] = typename T::BaseType(1 << (T::dimensions() - i)); } IMATH_INTERNAL_NAMESPACE::Box b1(p0, p1); assert(!b1.isInfinite()); } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min(0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b(min, max); assert(!b.isInfinite()); } } template void testHasVolume(const char *type) { cout << " hasVolume() for type " << type << endl; // // Empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert(!b.hasVolume()); } // // Infinite box. // { IMATH_INTERNAL_NAMESPACE::Box b; b.makeInfinite(); assert(b.hasVolume()); } // // Non-empty, has-volume box. // 2D: [(-2, -4), ( 8, 2) ] // 3D: [(-2, -4, -6), (12, 8, 2) ] // 4D: [(-2, -4, -6, -8), (16, 12, 8, 4) ] // { IMATH_INTERNAL_NAMESPACE::Box b0(T(-1), T(1)); assert(b0.hasVolume()); T p0; T p1; for (unsigned int i = 0; i < T::dimensions(); i++) { p0[i] = -typename T::BaseType(1 << (i + 1)); p1[i] = typename T::BaseType(1 << (T::dimensions() - i)); } IMATH_INTERNAL_NAMESPACE::Box b1(p0, p1); assert(b1.hasVolume()); } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (0, 2) ] // 3D: [(0, 0, 0), (0, 0, 2) ] // 4D: [(0, 0, 0, 0), (0, 0, 0, 2)] // { T min(0); T max = min; max[T::dimensions() - 1] = 2; IMATH_INTERNAL_NAMESPACE::Box b(min, max); assert(!b.hasVolume()); } } template void testMajorAxis(const char *type) { cout << " majorAxis() for type " << type << endl; // // Empty box. // { IMATH_INTERNAL_NAMESPACE::Box b; assert(b.majorAxis() == 0); } // // Non-empty, has-volume box. // Boxes are [ (0, 0, ...), () ] // { std::vector perms; permutations(perms); for (unsigned int i = 0; i < perms.size(); i++) { IMATH_INTERNAL_NAMESPACE::Box b(T(0), perms[i]); unsigned int major = 0; T size = perms[i] - T(0); for (unsigned int j = 1; j < T::dimensions(); j++) if (size[j] > size[major]) major = j; assert(b.majorAxis() == major); } } // // Non-empty, no-volume box. // Boxes are: // 2D: [(0, 0), (1, 0) ] // 2D: [(0, 0), (0, 1) ] // // 3D: [(0, 0), (1, 0, 0) ] // 3D: [(0, 0), (0, 1, 0) ] // 3D: [(0, 0), (0, 0, 1) ] // // and similarly for 4D // { for (unsigned int i = 0; i < T::dimensions(); i++) { for (unsigned int j = 0; j < T::dimensions(); j++) { T max(0); max[j] = 1; IMATH_INTERNAL_NAMESPACE::Box b(T(0), max); assert(b.majorAxis() == j); } } } } } // anonymous namespace void testBox() { cout << "Testing box methods" << endl; // // Constructors // testConstructors("V2s"); testConstructors("V2i"); testConstructors("V2f"); testConstructors("V2d"); testConstructors("V3s"); testConstructors("V3i"); testConstructors("V3f"); testConstructors("V3d"); testConstructors("V4s"); testConstructors("V4i"); testConstructors("V4f"); testConstructors("V4d"); // // makeEmpty() // testMakeEmpty("V2s"); testMakeEmpty("V2i"); testMakeEmpty("V2f"); testMakeEmpty("V2d"); testMakeEmpty("V3s"); testMakeEmpty("V3i"); testMakeEmpty("V3f"); testMakeEmpty("V3d"); testMakeEmpty("V4s"); testMakeEmpty("V4i"); testMakeEmpty("V4f"); testMakeEmpty("V4d"); // // makeInfinite() // testMakeInfinite("V2s"); testMakeInfinite("V2i"); testMakeInfinite("V2f"); testMakeInfinite("V2d"); testMakeInfinite("V3s"); testMakeInfinite("V3i"); testMakeInfinite("V3f"); testMakeInfinite("V3d"); testMakeInfinite("V4s"); testMakeInfinite("V4i"); testMakeInfinite("V4f"); testMakeInfinite("V4d"); // // extendBy() (point) // testExtendByPoint("V2s"); testExtendByPoint("V2i"); testExtendByPoint("V2f"); testExtendByPoint("V2d"); testExtendByPoint("V3s"); testExtendByPoint("V3i"); testExtendByPoint("V3f"); testExtendByPoint("V3d"); testExtendByPoint("V4s"); testExtendByPoint("V4i"); testExtendByPoint("V4f"); testExtendByPoint("V4d"); // // extendBy() box // testExtendByBox("V2s"); testExtendByBox("V2i"); testExtendByBox("V2f"); testExtendByBox("V2d"); testExtendByBox("V3s"); testExtendByBox("V3i"); testExtendByBox("V3f"); testExtendByBox("V3d"); testExtendByBox("V4s"); testExtendByBox("V4i"); testExtendByBox("V4f"); testExtendByBox("V4d"); // // == and !== // testComparators("V2s"); testComparators("V2i"); testComparators("V2f"); testComparators("V2d"); testComparators("V3s"); testComparators("V3i"); testComparators("V3f"); testComparators("V3d"); testComparators("V4s"); testComparators("V4i"); testComparators("V4f"); testComparators("V4d"); // // size() // testSize("V2s"); testSize("V2i"); testSize("V2f"); testSize("V2d"); testSize("V3s"); testSize("V3i"); testSize("V3f"); testSize("V3d"); testSize("V4s"); testSize("V4i"); testSize("V4f"); testSize("V4d"); // // center() // testCenter("V2s"); testCenter("V2i"); testCenter("V2f"); testCenter("V2d"); testCenter("V3s"); testCenter("V3i"); testCenter("V3f"); testCenter("V3d"); testCenter("V4s"); testCenter("V4i"); testCenter("V4f"); testCenter("V4d"); // // isEmpty() // testIsEmpty("V2s"); testIsEmpty("V2i"); testIsEmpty("V2f"); testIsEmpty("V2d"); testIsEmpty("V3s"); testIsEmpty("V3i"); testIsEmpty("V3f"); testIsEmpty("V3d"); testIsEmpty("V4s"); testIsEmpty("V4i"); testIsEmpty("V4f"); testIsEmpty("V4d"); // // isInfinite() // testIsInfinite("V2s"); testIsInfinite("V2i"); testIsInfinite("V2f"); testIsInfinite("V2d"); testIsInfinite("V3s"); testIsInfinite("V3i"); testIsInfinite("V3f"); testIsInfinite("V3d"); testIsInfinite("V4s"); testIsInfinite("V4i"); testIsInfinite("V4f"); testIsInfinite("V4d"); // // hasVolume() // testHasVolume("V2s"); testHasVolume("V2i"); testHasVolume("V2f"); testHasVolume("V2d"); testHasVolume("V3s"); testHasVolume("V3i"); testHasVolume("V3f"); testHasVolume("V3d"); testHasVolume("V4s"); testHasVolume("V4i"); testHasVolume("V4f"); testHasVolume("V4d"); // // majorAxis() // testMajorAxis("V2s"); testMajorAxis("V2i"); testMajorAxis("V2f"); testMajorAxis("V2d"); testMajorAxis("V3s"); testMajorAxis("V3i"); testMajorAxis("V3f"); testMajorAxis("V3d"); testMajorAxis("V4s"); testMajorAxis("V4i"); testMajorAxis("V4f"); testMajorAxis("V4d"); cout << "ok\n" << endl; }