From 62305ecb45afce8a47baee27edff69f17e9c5d46 Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Fri, 3 Feb 2023 21:08:47 +0000 Subject: [PATCH] Replace fragment of unit test code with trim_trailing_new_line() --- tests/test_SupportedFileSystems.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/test_SupportedFileSystems.cc b/tests/test_SupportedFileSystems.cc index a5d61b6b..51177d18 100644 --- a/tests/test_SupportedFileSystems.cc +++ b/tests/test_SupportedFileSystems.cc @@ -314,12 +314,7 @@ const std::string SupportedFileSystemsTest::create_loopdev(const std::string& im return ""; } - // Strip trailing New Line. - size_t len = output.length(); - if (len > 0 && output[len-1] == '\n') - output.resize(len-1); - - return output; + return Utils::trim_trailing_new_line(output); }