mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Reimplement FrameAllocator and FrameTemp; Tidy up DataChunker header.
- Also additional work on tests to reflect watermark behavior change
This commit is contained in:
parent
7332dd6643
commit
45898694e4
4 changed files with 154 additions and 227 deletions
|
|
@ -89,13 +89,13 @@ TEST(FrameAllocatorTest, FrameAllocator_Should_Function_Correctly)
|
|||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 104);
|
||||
|
||||
FrameAllocator::alloc(1);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 108);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 105);
|
||||
FrameAllocator::alloc(5);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 116);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 107); // 5 bytes == 2 ints
|
||||
|
||||
FrameAllocator::setWaterMark(0);
|
||||
FrameAllocator::alloc(1);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 4);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMarkBytes() == 4);
|
||||
|
||||
FrameAllocator::setWaterMark(0);
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ TEST(FrameTempTest, FrameTempShould_Function_Correctly)
|
|||
FrameAllocator::setWaterMark(0);
|
||||
{
|
||||
FrameTemp<TestAlignmentStruct> fooTemp(20);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == sizeof(TestAlignmentStruct)*20);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMarkBytes() == sizeof(TestAlignmentStruct)*20);
|
||||
EXPECT_TRUE(&fooTemp[0] == fooTemp.address());
|
||||
EXPECT_TRUE((&fooTemp[1] - &fooTemp[0]) == 1);
|
||||
EXPECT_TRUE(fooTemp.getObjectCount() == 20);
|
||||
|
|
@ -171,7 +171,7 @@ TEST(FrameTempTest, FrameTempShould_Function_Correctly)
|
|||
}
|
||||
|
||||
// Exiting scope sets watermark
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMark() == 0);
|
||||
EXPECT_TRUE(FrameAllocator::getWaterMarkBytes() == 0);
|
||||
|
||||
// Test the destructor actually gets called
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue