mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
feat(memory): replace global new and delete operators
This commit is contained in:
parent
20457f7d4c
commit
f75d9caba3
2 changed files with 38 additions and 0 deletions
|
|
@ -5,6 +5,24 @@
|
|||
#include <numeric>
|
||||
#include <vector>
|
||||
|
||||
TEST_CASE("operator new", "[memory]") {
|
||||
SECTION("allocates memory") {
|
||||
auto ptr = new int32_t;
|
||||
REQUIRE(ptr != nullptr);
|
||||
|
||||
delete ptr;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("operator new[]", "[memory]") {
|
||||
SECTION("allocates memory") {
|
||||
auto ptr = new int32_t[10];
|
||||
REQUIRE(ptr != nullptr);
|
||||
|
||||
delete[] ptr;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("SMemAlloc", "[memory]") {
|
||||
SECTION("allocates memory") {
|
||||
void* ptr = SMemAlloc(16, __FILE__, __LINE__);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue