From 6e7459322d8336bfe52e390ab4a1b2e82e24c05e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 26 Jan 2023 18:58:09 +0000 Subject: AK: Remove StringBuilder::build() in favor of to_deprecated_string() Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change. --- Tests/LibC/TestRealpath.cpp | 4 ++-- Tests/LibC/TestSnprintf.cpp | 2 +- Tests/LibC/TestStrlcpy.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Tests/LibC') diff --git a/Tests/LibC/TestRealpath.cpp b/Tests/LibC/TestRealpath.cpp index 1bb34eaa0a..86c259f66b 100644 --- a/Tests/LibC/TestRealpath.cpp +++ b/Tests/LibC/TestRealpath.cpp @@ -50,7 +50,7 @@ TEST_CASE(overlong_realpath) expected.append({ tmp_dir, strlen(tmp_dir) }); // But first, demonstrate the functionality at a reasonable depth: - auto expected_str = expected.build(); + auto expected_str = expected.to_deprecated_string(); check_result("getwd", expected_str, getwd(static_cast(calloc(1, PATH_MAX)))); check_result("getcwd", expected_str, getcwd(nullptr, 0)); check_result("realpath", expected_str, realpath(".", nullptr)); @@ -74,7 +74,7 @@ TEST_CASE(overlong_realpath) outln("cwd should now be ridiculously large"); // Evaluate - expected_str = expected.build(); + expected_str = expected.to_deprecated_string(); check_result("getwd", {}, getwd(static_cast(calloc(1, PATH_MAX)))); check_result("getcwd", expected_str, getcwd(nullptr, 0)); diff --git a/Tests/LibC/TestSnprintf.cpp b/Tests/LibC/TestSnprintf.cpp index 055a64b37c..c7535db722 100644 --- a/Tests/LibC/TestSnprintf.cpp +++ b/Tests/LibC/TestSnprintf.cpp @@ -43,7 +43,7 @@ static DeprecatedString show(ByteBuffer const& buf) builder.append('_'); } builder.append(')'); - return builder.build(); + return builder.to_deprecated_string(); } template diff --git a/Tests/LibC/TestStrlcpy.cpp b/Tests/LibC/TestStrlcpy.cpp index c766429a04..01d97e45c0 100644 --- a/Tests/LibC/TestStrlcpy.cpp +++ b/Tests/LibC/TestStrlcpy.cpp @@ -37,7 +37,7 @@ static DeprecatedString show(ByteBuffer const& buf) builder.append('_'); } builder.append(')'); - return builder.build(); + return builder.to_deprecated_string(); } static bool test_single(Testcase const& testcase) -- cgit v1.2.3