mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-03 16:39:08 +00:00
chore(region): test for SRgnDelete
This commit is contained in:
parent
335962e3fc
commit
83f22d53a8
1 changed files with 21 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ TEST_CASE("SRgnClear", "[region]") {
|
||||||
TEST_CASE("SRgnCreate", "[region]") {
|
TEST_CASE("SRgnCreate", "[region]") {
|
||||||
SECTION("sets handle pointer to new region handle") {
|
SECTION("sets handle pointer to new region handle") {
|
||||||
HSRGN region = nullptr;
|
HSRGN region = nullptr;
|
||||||
SRgnCreate(®ion, 0);
|
SRgnCreate(®ion);
|
||||||
|
|
||||||
REQUIRE(region != nullptr);
|
REQUIRE(region != nullptr);
|
||||||
|
|
||||||
|
|
@ -92,6 +92,26 @@ TEST_CASE("SRgnCombineRectf", "[region]") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("SRgnDelete", "[region]") {
|
||||||
|
SECTION("deletes region data") {
|
||||||
|
HSRGN region = nullptr;
|
||||||
|
SRgnCreate(®ion);
|
||||||
|
|
||||||
|
RECTF baseRect = { -1.0f, 1.0f, 1.0f, 2.0f };
|
||||||
|
SRgnCombineRectf(region, &baseRect, nullptr, SRGN_OR);
|
||||||
|
|
||||||
|
uint32_t numrects = 0;
|
||||||
|
|
||||||
|
SRgnGetRectsf(region, &numrects, nullptr);
|
||||||
|
CHECK(numrects == 1);
|
||||||
|
|
||||||
|
SRgnDelete(region);
|
||||||
|
|
||||||
|
SRgnGetRectsf(region, &numrects, nullptr);
|
||||||
|
CHECK(numrects == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("SRgnDuplicate", "[region]") {
|
TEST_CASE("SRgnDuplicate", "[region]") {
|
||||||
RgnDataTest region;
|
RgnDataTest region;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue