chromium/cc/base/math_util_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "cc/base/math_util.h"

#include <stdint.h>

#include <cmath>
#include <limits>

#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/quad_f.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/test/geometry_util.h"
#include "ui/gfx/geometry/transform.h"

namespace cc {
namespace {

TEST(MathUtilTest, ProjectionOfPerpendicularPlane) {}

TEST(MathUtilTest, ProjectionOfAlmostPerpendicularPlane) {}

TEST(MathUtilTest, EnclosingClippedRectHandlesInfinityY) {}

TEST(MathUtilTest, EnclosingClippedRectHandlesNegativeInfinityX) {}

TEST(MathUtilTest, EnclosingClippedRectHandlesInfinityXY) {}

TEST(MathUtilTest, EnclosingClippedRectUsesCorrectInitialBounds) {}

TEST(MathUtilTest, EnclosingClippedRectHandlesSmallPositiveW) {}

TEST(MathUtilTest, EnclosingRectOfVerticesUsesCorrectInitialBounds) {}

TEST(MathUtilTest, SmallestAngleBetweenVectors) {}

TEST(MathUtilTest, VectorProjection) {}

TEST(MathUtilTest, MapEnclosedRectWith2dAxisAlignedTransform) {}

TEST(MathUtilTest, MapEnclosingRectWithLargeTransforms) {}

TEST(MathUtilTest, MapEnclosingRectIgnoringError) {}

TEST(MathUtilTest, ProjectEnclosingRectWithLargeTransforms) {}

TEST(MathUtilTest, RoundUp) {}

TEST(MathUtilTest, RoundUpOverflow) {}

TEST(MathUtilTest, RoundDown) {}

TEST(MathUtilTest, RoundDownUnderflow) {}

#define EXPECT_SIMILAR_VALUE(x, y)
#define EXPECT_DISSIMILAR_VALUE(x, y)

// Arbitrary point that shouldn't be different from zero.
static const float zeroish =;

TEST(MathUtilTest, Approximate) {}

#define EXPECT_SIMILAR_POINT_F(x, y)
#define EXPECT_DISSIMILAR_POINT_F(x, y)

TEST(MathUtilTest, ApproximatePointF) {}

#define EXPECT_SIMILAR_POINT_3F(x, y)
#define EXPECT_DISSIMILAR_POINT_3F(x, y)

TEST(MathUtilTest, ApproximatePoint3F) {}

// This takes a quad for which two points, (at x = -99) are behind and below
// the eyepoint and checks to make sure we build a quad that doesn't include
// anything from w<0 space.  We used to build a degenerate quad.
TEST(MathUtilTest, MapClippedQuadDuplicateTriangle) {}

// This takes a quad for which two points are identical and checks to make
// sure we build a triangle.
TEST(MathUtilTest, MapClippedQuadDuplicatePoints) {}

// This takes a quad for which two points are identical and checks to make
// sure we build a triangle.  The quirk here is that the two shared points are
// first and last, not sequential.
TEST(MathUtilTest, MapClippedQuadDuplicatePointsWrapped) {}

// Here we map and clip a quad with only one point that disappears to infinity
// behind us.  We don't want two vertices at infinity crossing in and out
// of w < 0 space.
TEST(MathUtilTest, MapClippedQuadDuplicateQuad) {}

#define EXPECT_LT_LT(a, b, c)

#define EXPECT_LE_LT(a, b, c)

#define EXPECT_LT_LE(a, b, c)

#define EXPECT_LE_LE(a, b, c)

// Here we map and clip a quad with a point that disappears to infinity behind
// us while staying finite in one dimension (i.e., x goes to 0 as w goes to 0,
// and x' is constant along the edge).
TEST(MathUtilTest, MapClippedQuadInfiniteInSomeDimensions) {}

// Here we map and clip a quad with a point that disappears to infinity behind
// us while staying finite in one dimension (i.e., x goes to 0 as w goes to 0,
// and x' is constant along the edge).  This differs from the previous test
// in that the edge with constant x' is at 100 rather than 0.
TEST(MathUtilTest, MapClippedQuadInfiniteInSomeDimensionsNonZero) {}

// Test that planes that are parallel to the z axis (other than those going
// through the origin!) just fall through to clipping by points.
TEST(MathUtilTest, MapClippedQuadClampInvisiblePlane) {}

// Test that when the plane passes too far from the origin, we bring it closer
// before clamping coordinates.
TEST(MathUtilTest, MapClippedQuadClampWholePlane) {}

// Like the previous test, but with a plane with large negative z.
TEST(MathUtilTest, MapClippedQuadClampWholePlaneBelow) {}

TEST(MathUtilTest, MapClippedQuadInfiniteMatrix) {}

}  // namespace
}  // namespace cc