#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/gfx/geometry/rect.h"
#include <stddef.h>
#include <limits>
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/test/geometry_util.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
#endif
namespace gfx {
constexpr int kMaxInt = …;
constexpr int kMinInt = …;
TEST(RectTest, Contains) { … }
TEST(RectTest, Intersects) { … }
TEST(RectTest, Intersect) { … }
TEST(RectTest, InclusiveIntersect) { … }
TEST(RectTest, Union) { … }
TEST(RectTest, UnionEvenIfEmpty) { … }
TEST(RectTest, Equals) { … }
TEST(RectTest, AdjustToFit) { … }
TEST(RectTest, Subtract) { … }
TEST(RectTest, IsEmpty) { … }
TEST(RectTest, SplitVertically) { … }
TEST(RectTest, SplitHorizontally) { … }
TEST(RectTest, CenterPoint) { … }
TEST(RectTest, SharesEdgeWith) { … }
static void TestScaleRectOverflowClamp(Rect (*function)(const Rect&,
float,
float)) { … }
TEST(RectTest, ScaleToEnclosedRect) { … }
TEST(RectTest, ScaleToEnclosingRect) { … }
TEST(RectTest, ScaleToRoundedRect) { … }
#if BUILDFLAG(IS_WIN)
TEST(RectTest, ConstructAndAssign) {
const RECT rect_1 = { 0, 0, 10, 10 };
const RECT rect_2 = { 0, 0, -10, -10 };
Rect test1(rect_1);
Rect test2(rect_2);
}
#endif
TEST(RectTest, BoundingRect) { … }
TEST(RectTest, Offset) { … }
TEST(RectTest, Corners) { … }
TEST(RectTest, Centers) { … }
TEST(RectTest, Transpose) { … }
TEST(RectTest, ManhattanDistanceToPoint) { … }
TEST(RectTest, ManhattanInternalDistance) { … }
TEST(RectTest, IntegerOverflow) { … }
TEST(RectTest, Inset) { … }
TEST(RectTest, Outset) { … }
TEST(RectTest, InsetOutsetClamped) { … }
TEST(RectTest, SetByBounds) { … }
TEST(RectTest, MaximumCoveredRect) { … }
}