App/Toponaming: Add base64 encoding to XML
This commit is contained in:
@@ -114,3 +114,18 @@ TEST_F(WriterTest, charStream)
|
||||
// Assert
|
||||
EXPECT_EQ(&streamA, &streamB);
|
||||
}
|
||||
|
||||
TEST_F(WriterTest, charStreamBase64Encoded)
|
||||
{
|
||||
// Arrange
|
||||
auto& stream {_writer.beginCharStream(Base::CharStreamFormat::Base64Encoded)};
|
||||
std::string data {"FreeCAD rocks! 🪨🪨🪨"};
|
||||
|
||||
// Act
|
||||
_writer.charStream() << data;
|
||||
_writer.endCharStream();
|
||||
|
||||
// Assert
|
||||
// Conversion done using https://www.base64encode.org for testing purposes
|
||||
EXPECT_EQ(std::string("RnJlZUNBRCByb2NrcyEg8J+qqPCfqqjwn6qo\n"), _writer.getString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user