mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
VERIFY macro removed
This commit is contained in:
parent
cc46f2d7e6
commit
05fb57baff
36 changed files with 108 additions and 145 deletions
|
|
@ -180,7 +180,7 @@ namespace cfg
|
|||
for (const auto& v : init)
|
||||
{
|
||||
// Ensure elements are unique
|
||||
VERIFY(map.emplace(v.first, v.second).second);
|
||||
verify(HERE), map.emplace(v.first, v.second).second;
|
||||
}
|
||||
|
||||
return map;
|
||||
|
|
|
|||
|
|
@ -201,33 +201,6 @@ std::string fs::get_parent_dir(const std::string& path)
|
|||
}
|
||||
}
|
||||
|
||||
static const auto test_get_parent_dir = []() -> bool
|
||||
{
|
||||
// Success:
|
||||
VERIFY(fs::get_parent_dir("/x/y///") == "/x");
|
||||
VERIFY(fs::get_parent_dir("/x/y/") == "/x");
|
||||
VERIFY(fs::get_parent_dir("/x/y") == "/x");
|
||||
VERIFY(fs::get_parent_dir("x:/y") == "x:");
|
||||
VERIFY(fs::get_parent_dir("//x/y") == "//x");
|
||||
|
||||
// Failure:
|
||||
VERIFY(fs::get_parent_dir("").empty());
|
||||
VERIFY(fs::get_parent_dir("x/").empty());
|
||||
VERIFY(fs::get_parent_dir("x").empty());
|
||||
VERIFY(fs::get_parent_dir("x///").empty());
|
||||
VERIFY(fs::get_parent_dir("/x/").empty());
|
||||
VERIFY(fs::get_parent_dir("/x").empty());
|
||||
VERIFY(fs::get_parent_dir("/").empty());
|
||||
VERIFY(fs::get_parent_dir("//").empty());
|
||||
VERIFY(fs::get_parent_dir("//x").empty());
|
||||
VERIFY(fs::get_parent_dir("//x/").empty());
|
||||
VERIFY(fs::get_parent_dir("///").empty());
|
||||
VERIFY(fs::get_parent_dir("///x").empty());
|
||||
VERIFY(fs::get_parent_dir("///x/").empty());
|
||||
|
||||
return false;
|
||||
}();
|
||||
|
||||
bool fs::stat(const std::string& path, stat_t& info)
|
||||
{
|
||||
if (auto device = get_virtual_device(path))
|
||||
|
|
|
|||
|
|
@ -2200,26 +2200,26 @@ void thread_ctrl::handle_interrupt()
|
|||
|
||||
void thread_ctrl::interrupt(void(*handler)())
|
||||
{
|
||||
VERIFY(this != g_tls_this_thread); // TODO: self-interrupt
|
||||
VERIFY(m_data->interrupt.compare_and_swap_test(nullptr, handler)); // TODO: multiple interrupts
|
||||
verify(HERE), this != g_tls_this_thread; // TODO: self-interrupt
|
||||
verify(HERE), m_data->interrupt.compare_and_swap_test(nullptr, handler); // TODO: multiple interrupts
|
||||
|
||||
#ifdef _WIN32
|
||||
const auto ctx = m_data->thread_ctx;
|
||||
|
||||
const HANDLE nt = OpenThread(THREAD_ALL_ACCESS, FALSE, m_data->thread_id);
|
||||
VERIFY(nt);
|
||||
VERIFY(SuspendThread(nt) != -1);
|
||||
verify(HERE), nt;
|
||||
verify(HERE), SuspendThread(nt) != -1;
|
||||
|
||||
ctx->ContextFlags = CONTEXT_FULL;
|
||||
VERIFY(GetThreadContext(nt, ctx));
|
||||
verify(HERE), GetThreadContext(nt, ctx);
|
||||
|
||||
ctx->ContextFlags = CONTEXT_FULL;
|
||||
const u64 _rip = RIP(ctx);
|
||||
RIP(ctx) = (u64)std::addressof(thread_ctrl::handle_interrupt);
|
||||
VERIFY(SetThreadContext(nt, ctx));
|
||||
verify(HERE), SetThreadContext(nt, ctx);
|
||||
|
||||
RIP(ctx) = _rip;
|
||||
VERIFY(ResumeThread(nt) != -1);
|
||||
verify(HERE), ResumeThread(nt) != -1;
|
||||
CloseHandle(nt);
|
||||
#else
|
||||
pthread_kill(reinterpret_cast<std::thread&>(m_thread).native_handle(), SIGUSR1);
|
||||
|
|
|
|||
|
|
@ -61,9 +61,7 @@
|
|||
// Wrap an expression into lambda. Obsolete.
|
||||
#define WRAP_EXPR(...) [&] { return __VA_ARGS__; }
|
||||
|
||||
// Ensure that the expression is evaluated to true. Obsolete.
|
||||
#define VERIFY(...) do { if (!(__VA_ARGS__)) fmt::raw_error("Verification failed: " #__VA_ARGS__ HERE); } while (0)
|
||||
|
||||
// Ensure that the expression evaluates to true. Obsolete.
|
||||
#define EXPECTS(...) do { if (!(__VA_ARGS__)) fmt::raw_error("Precondition failed: " #__VA_ARGS__ HERE); } while (0)
|
||||
#define ENSURES(...) do { if (!(__VA_ARGS__)) fmt::raw_error("Postcondition failed: " #__VA_ARGS__ HERE); } while (0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue