mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
split debug_assert into ENSURE and ASSERT as discussed in a previous meeting.
the old debug_assert always ran and tested the expression, which slows down release builds. wrapping them in #ifndef NDEBUG is clumsy. the new ASSERT behaves like assert and ENSURE like the old debug_assert. Let's change any time-critical but not-super-important ENSURE to ASSERT to speed up release builds. (already done in bits.h and unique_range.h) This was SVN commit r9362.
This commit is contained in:
@@ -114,9 +114,9 @@ void ScriptTestSetup(ScriptInterface& ifc)
|
||||
// (We don't use VFS because tests might not have the normal VFS paths loaded)
|
||||
OsPath path = DataDir()/"tests/test_setup.js";
|
||||
std::ifstream ifs(OsString(path).c_str());
|
||||
debug_assert(ifs.good());
|
||||
ENSURE(ifs.good());
|
||||
std::string content((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
|
||||
std::wstring wcontent(content.begin(), content.end());
|
||||
bool ok = ifc.LoadScript(L"test_setup.js", wcontent);
|
||||
debug_assert(ok);
|
||||
ENSURE(ok);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user