mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:47:35 +00:00
Tests: Make TestSourceLocation basic_scenario specify StringView length
This commit is contained in:
parent
3d656ba600
commit
3e1d0d9425
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…
Add table
Add a link
Reference in a new issue