1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00

Merge pull request #4106 from IntelOrca/improve-assertions

Improve guard assertions so that they display the location of where the guard was and also allow a dump file to be created on abort.
This commit is contained in:
Ted John
2016-07-16 15:12:30 +01:00
committed by GitHub
12 changed files with 97 additions and 31 deletions

View File

@@ -56,7 +56,7 @@ static bool AllocatedListContains(uint32 baseImageId, uint32 count)
static uint32 AllocateImageList(uint32 count)
{
Guard::Assert(count != 0);
Guard::Assert(count == 0, GUARD_LINE);
if (!_initialised)
{
@@ -92,12 +92,12 @@ static uint32 AllocateImageList(uint32 count)
static void FreeImageList(uint32 baseImageId, uint32 count)
{
Guard::Assert(_initialised);
Guard::Assert(baseImageId >= BASE_IMAGE_ID);
Guard::Assert(_initialised, GUARD_LINE);
Guard::Assert(baseImageId >= BASE_IMAGE_ID, GUARD_LINE);
#ifdef DEBUG
bool contains = AllocatedListContains(baseImageId, count);
Guard::Assert(contains);
Guard::Assert(contains, GUARD_LINE);
#endif
for (auto it = _freeLists.begin(); it != _freeLists.end(); it++)