mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 00:57:44 -04:00
parent
c1faeac042
commit
9449078a9b
|
@ -1,7 +1,9 @@
|
|||
#include "Assert.h"
|
||||
|
||||
#ifndef NO_ASSERT
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "Assert.h"
|
||||
#include <string_view>
|
||||
|
||||
void private_assert_failed(const char* expr,
|
||||
|
@ -32,3 +34,5 @@ void private_assert_failed(const char* expr,
|
|||
private_assert_failed(expr, file, line, function, msg.data());
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifndef NO_ASSERT
|
||||
|
||||
#include <string_view>
|
||||
|
||||
[[noreturn]] void private_assert_failed(const char* expr,
|
||||
|
@ -28,3 +30,10 @@
|
|||
|
||||
#define ASSERT_MSG(EXPR, STR) \
|
||||
(void)((EXPR) || (private_assert_failed(#EXPR, __FILE__, __LINE__, __PRETTY_FUNCTION__, STR), 0))
|
||||
|
||||
#else
|
||||
|
||||
#define ASSERT(EX) ((void)0)
|
||||
#define ASSERT_MSG(EXPR, STR) ((void)0)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "common/util/print_float.h"
|
||||
#include "decompiler/IR2/ExpressionHelpers.h"
|
||||
#include "decompiler/util/goal_constants.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
/*
|
||||
* TODO
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "common/util/CopyOnWrite.h"
|
||||
#include "common/util/SmallVector.h"
|
||||
#include "common/util/crc32.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
TEST(CommonUtil, CpuInfo) {
|
||||
setup_cpu_info();
|
||||
|
@ -393,9 +394,11 @@ TEST(SmallVector, Construction) {
|
|||
EXPECT_FALSE(one.empty());
|
||||
}
|
||||
|
||||
#ifndef NO_ASSERT
|
||||
TEST(Assert, Death) {
|
||||
EXPECT_DEATH(private_assert_failed("foo", "bar", 12, "aaa"), "");
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t crc_reference(const u8* data, size_t size) {
|
||||
u32 crc = 0xffffffff;
|
||||
|
@ -419,4 +422,4 @@ TEST(CRC32, Reference) {
|
|||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace cu
|
||||
} // namespace cu
|
||||
|
|
Loading…
Reference in a new issue