Move extractClassName to the single calling TU and make it static

This commit is contained in:
Martin Hořeňovský committed 2021-06-18 23:39:07 +02:00
1 parent 70f5392210
commit 28a33497be
3 files changed
+17 -17

No files matched your search

@@ -12,7 +12,6 @@
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
#include <catch2/internal/catch_random_number_generator.hpp>
#include <catch2/internal/catch_run_context.hpp>
#include <catch2/internal/catch_string_manip.hpp>
#include <catch2/catch_test_case_info.hpp>
#include <catch2/catch_test_spec.hpp>
@@ -149,17 +148,4 @@ namespace {
m_testAsFunction();
}
std::string extractClassName( StringRef classOrQualifiedMethodName ) {
std::string className(classOrQualifiedMethodName);
if( startsWith( className, '&' ) )
{
std::size_t lastColons = className.rfind( "::" );
std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
if( penultimateColons == std::string::npos )
penultimateColons = 1;
className = className.substr( penultimateColons, lastColons-penultimateColons );
}
return className;
}
} // end namespace Catch