Test: Add test cases for Persistence::validateXMLString
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#endif
|
||||
|
||||
#include "Base/Exception.h"
|
||||
#include "Base/Persistence.h"
|
||||
#include "Base/Reader.h"
|
||||
#include <array>
|
||||
#include <filesystem>
|
||||
@@ -459,3 +460,13 @@ TEST_F(ReaderTest, validDefaults)
|
||||
EXPECT_THROW({ xml.Reader()->getAttribute<TimesIGoToBed>("missing"); }, Base::XMLBaseException);
|
||||
EXPECT_EQ(value20, TimesIGoToBed::Late);
|
||||
}
|
||||
|
||||
TEST_F(ReaderTest, validateXmlString)
|
||||
{
|
||||
std::string input = "abcde";
|
||||
std::string output = input;
|
||||
input.push_back(char(15));
|
||||
output.push_back('_');
|
||||
std::string result = Base::Persistence::validateXMLString(input);
|
||||
EXPECT_EQ(output, result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user