123456789101112131415161718192021222324252627 |
- #include "../Tests.hpp"
- #include "core/utils/New.hpp"
- struct NewTestClass {
- int i;
- };
- static void testNewArray() {
- NewTestClass* n = new(noThrow) NewTestClass[5];
- delete[] n;
- }
- static void testNewFlat() {
- NewTestClass* n = new(noThrow) NewTestClass();
- delete n;
- }
- static void testNewArrayWithSize() {
- NewTestClass* n = new(noThrow) NewTestClass[5];
- operator delete[](n, 5);
- }
- void Core::testNew() {
- testNewArray();
- testNewFlat();
- testNewArrayWithSize();
- }
|