mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
Tests: Make TestSourceLocation basic_scenario specify StringView length
This commit is contained in:
parent
3d656ba600
commit
3e1d0d9425
Notes:
sideshowbarker
2024-07-17 09:27:46 +09:00
Author: https://github.com/sin-ack Commit: https://github.com/SerenityOS/serenity/commit/3e1d0d9425 Pull-request: https://github.com/SerenityOS/serenity/pull/14555 Reviewed-by: https://github.com/Dexesttp ✅ Reviewed-by: https://github.com/kleinesfilmroellchen
1 changed files with 8 additions and 3 deletions
|
@ -13,9 +13,14 @@
|
|||
TEST_CASE(basic_scenario)
|
||||
{
|
||||
auto location = SourceLocation::current();
|
||||
EXPECT_EQ(StringView(__FUNCTION__), location.function_name());
|
||||
EXPECT_EQ(__LINE__ - 2u, location.line_number());
|
||||
EXPECT_EQ(StringView(__FILE__), location.filename());
|
||||
EXPECT_EQ(__LINE__ - 1u, location.line_number());
|
||||
|
||||
// Obviously not the prettiest way.
|
||||
StringView function { __FUNCTION__, strlen(__FUNCTION__) };
|
||||
StringView file { __FILE__, strlen(__FILE__) };
|
||||
|
||||
EXPECT_EQ(function, location.function_name());
|
||||
EXPECT_EQ(file, location.filename());
|
||||
}
|
||||
|
||||
static StringView test_default_arg(SourceLocation const& loc = SourceLocation::current())
|
||||
|
|
Loading…
Reference in a new issue