[ox/std] Enable unsafe buffer warnings
This commit is contained in:
4
deps/ox/src/ox/std/test/tests.cpp
vendored
4
deps/ox/src/ox/std/test/tests.cpp
vendored
@@ -121,7 +121,9 @@ static std::map<ox::StringView, ox::Error(*)()> tests = {
|
||||
auto a1 = static_cast<char*>(ox::heapmgr::malloc(5));
|
||||
auto a2 = static_cast<char*>(ox::heapmgr::malloc(5));
|
||||
oxAssert(a1 >= buff.front().unwrap() && a1 < buff.back().unwrap(), "malloc is broken");
|
||||
OX_CLANG_NOWARN_BEGIN(-Wunsafe-buffer-usage)
|
||||
oxAssert(a2 >= buff.front().unwrap() && a2 < buff.back().unwrap() && a2 > a1 + 5, "malloc is broken");
|
||||
OX_CLANG_NOWARN_END
|
||||
ox::heapmgr::free(a1);
|
||||
ox::heapmgr::free(a2);
|
||||
return OxError(0);
|
||||
@@ -474,7 +476,9 @@ int main(int argc, const char **args) {
|
||||
if (argc < 2) {
|
||||
oxError("Must specify test to run");
|
||||
}
|
||||
OX_CLANG_NOWARN_BEGIN(-Wunsafe-buffer-usage)
|
||||
auto const testName = args[1];
|
||||
OX_CLANG_NOWARN_END
|
||||
auto const func = tests.find(testName);
|
||||
if (func != tests.end()) {
|
||||
oxAssert(func->second(), "Test returned Error");
|
||||
|
||||
Reference in New Issue
Block a user