mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Implement getCallStackFast/Exact for fast call-stack backtrace.
This commit is contained in:
@@ -19,7 +19,7 @@ bool testAssertHandler(const bx::Location& _location, uint32_t _skip, const char
|
||||
bx::printf("\n");
|
||||
|
||||
uintptr_t stack[32];
|
||||
const uint32_t num = bx::getCallStack(2 /* skip self */ + _skip, BX_COUNTOF(stack), stack);
|
||||
const uint32_t num = bx::getCallStackExact(2 /* skip self */ + _skip, BX_COUNTOF(stack), stack);
|
||||
bx::writeCallstack(bx::getStdOut(), stack, num, bx::ErrorIgnore{});
|
||||
|
||||
// Throwing exceptions is required for testing asserts being trigged.
|
||||
|
||||
@@ -45,7 +45,7 @@ TEST_CASE("StringLiteral", "[string]")
|
||||
|
||||
REQUIRE(5 == sv.getLength() );
|
||||
REQUIRE(5 == bx::strLen(sv) );
|
||||
REQUIRE(0 == bx::strCmp("abvgd", sv) );
|
||||
REQUIRE("abvgd" == sv);
|
||||
}
|
||||
|
||||
TEST_CASE("stringPrintfTy", "[string]")
|
||||
@@ -218,6 +218,19 @@ TEST_CASE("strCmpV sort", "[string][sort]")
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("overlap", "[string]")
|
||||
{
|
||||
const char* test = "The Quick Brown Fox Jumps Over The Lazy Dog.";
|
||||
|
||||
const bx::StringView quick = bx::strFind(test, "Quick");
|
||||
|
||||
REQUIRE(bx::overlap(quick, test) );
|
||||
|
||||
const bx::StringView empty;
|
||||
REQUIRE(!bx::overlap(quick, empty) );
|
||||
REQUIRE(!bx::overlap(test, empty) );
|
||||
}
|
||||
|
||||
TEST_CASE("strRFind", "[string]")
|
||||
{
|
||||
const char* test = "test";
|
||||
|
||||
Reference in New Issue
Block a user