Make XmlEncoding tests slightly more efficient

This commit is contained in:
Martin Hořeňovský 2020-08-18 13:47:58 +02:00
parent e418e75c74
commit f16be402f7
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
1 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
#include <catch2/catch_test_macros.hpp>
#include <catch2/internal/catch_xmlwriter.hpp>
#include <sstream>
#include <catch2/internal/catch_stream.hpp>
inline std::string encode( std::string const& str, Catch::XmlEncode::ForWhat forWhat = Catch::XmlEncode::ForTextNodes ) {
std::ostringstream oss;
static std::string encode( std::string const& str, Catch::XmlEncode::ForWhat forWhat = Catch::XmlEncode::ForTextNodes ) {
Catch::ReusableStringStream oss;
oss << Catch::XmlEncode( str, forWhat );
return oss.str();
}