feat(rect): add CRect

This commit is contained in:
fallenoak 2022-12-24 15:09:50 -06:00 committed by GitHub
parent ae7654ea64
commit 0623492fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 81 additions and 0 deletions

20
test/Rect.cpp Normal file
View file

@ -0,0 +1,20 @@
#include "tempest/Rect.hpp"
#include "test/Test.hpp"
TEST_CASE("CRect", "[rect]") {
SECTION("constructs with default constructor") {
CRect rect;
CHECK(rect.minY == 0.0f);
CHECK(rect.minX == 0.0f);
CHECK(rect.maxY == 0.0f);
CHECK(rect.maxX == 0.0f);
}
SECTION("constructs with minY minX maxY maxX constructor") {
auto rect = CRect(1.0f, 2.0f, 3.0f, 4.0f);
CHECK(rect.minY == 1.0f);
CHECK(rect.minX == 2.0f);
CHECK(rect.maxY == 3.0f);
CHECK(rect.maxX == 4.0f);
}
}