Enable assertions in native tests

This commit is contained in:
Wojciech Figat
2022-08-19 11:19:07 +02:00
parent bf30d7cd29
commit 01eb42dd10
2 changed files with 4 additions and 13 deletions

View File

@@ -39,7 +39,7 @@
#define ENABLE_ASSERTION 1
// Enable/disable assertion for Engine low layers
#define ENABLE_ASSERTION_LOW_LAYERS ENABLE_ASSERTION && (BUILD_DEBUG)
#define ENABLE_ASSERTION_LOW_LAYERS ENABLE_ASSERTION && (BUILD_DEBUG || FLAX_TESTS)
// Scripting API defines (see C++ scripting documentation for more info)
#define API_ENUM(...)

View File

@@ -12,16 +12,13 @@ template<int Capacity>
class FixedAllocation
{
public:
template<typename T>
class Data
{
private:
byte _data[Capacity * sizeof(T)];
public:
FORCE_INLINE Data()
{
}
@@ -48,14 +45,14 @@ public:
FORCE_INLINE void Allocate(uint64 capacity)
{
#if BUILD_DEBUG
#if ENABLE_ASSERTION_LOW_LAYERS
ASSERT(capacity <= Capacity);
#endif
}
FORCE_INLINE void Relocate(uint64 capacity, int32 oldCount, int32 newCount)
{
#if BUILD_DEBUG
#if ENABLE_ASSERTION_LOW_LAYERS
ASSERT(capacity <= Capacity);
#endif
}
@@ -80,16 +77,13 @@ public:
class HeapAllocation
{
public:
template<typename T>
class Data
{
private:
T* _data = nullptr;
public:
FORCE_INLINE Data()
{
}
@@ -133,7 +127,7 @@ public:
FORCE_INLINE void Allocate(uint64 capacity)
{
#if BUILD_DEBUG
#if ENABLE_ASSERTION_LOW_LAYERS
ASSERT(!_data);
#endif
_data = (T*)Allocator::Allocate(capacity * sizeof(T));
@@ -182,12 +176,10 @@ template<int Capacity, typename OtherAllocator = HeapAllocation>
class InlinedAllocation
{
public:
template<typename T>
class Data
{
private:
typedef typename OtherAllocator::template Data<T> OtherData;
bool _useOther = false;
@@ -195,7 +187,6 @@ public:
OtherData _other;
public:
FORCE_INLINE Data()
{
}