feat(region): add SRgnDestroy

This commit is contained in:
Adam Heinermann 2026-01-26 01:24:20 -08:00 committed by fallenoak
parent 1e1f2f819f
commit 1e86f98691
5 changed files with 55 additions and 2 deletions

View file

@ -1,6 +1,7 @@
#include "test/Test.hpp"
#include "EventTest.hpp"
#include "storm/Core.hpp"
#include "storm/Region.hpp"
TEST_CASE("StormDestroy", "[core]") {
SECTION("always returns 1") {
@ -36,4 +37,19 @@ TEST_CASE("StormDestroy", "[core]") {
CHECK(SEvtDispatch(0, 0, 0, nullptr) == 1);
}
}
SECTION("SRgn") {
SECTION("destroys region handles") {
HSRGN rgn = nullptr;
SRgnCreate(&rgn);
REQUIRE(rgn != nullptr); // valid handle
CHECK(StormDestroy() == 1);
// fails to duplicate because handle is invalid
HSRGN newrgn;
SRgnDuplicate(rgn, &newrgn);
CHECK(newrgn == nullptr);
}
}
}