stuff-from-scratch/test/publishing/TestSvgToNodeConverter.cpp
2023-01-17 17:41:27 +00:00

25 lines
No EOL
722 B
C++

#include "TestFramework.h"
#include "TestRenderUtils.h"
#include "TestUtils.h"
#include "SvgReader.h"
#include "SvgWriter.h"
#include "SvgNode.h"
TEST_CASE(TestSvgToNodeConverter, "publishing")
{
SvgReader svg_reader;
auto svg_doc = svg_reader.read(TestUtils::getTestDataDir() / "circles.svg");
SvgWriter svg_writer;
svg_writer.toFile(TestUtils::getTestOutputDir(__FILE__) / "TestSvgToNodeConverter.svg", svg_doc.get());
TestRenderer renderer;
auto svg_node = std::make_unique<SvgNode>(Point(0.0, 0.0));
svg_node->setContent(std::move(svg_doc));
renderer.getScene()->addNode(svg_node.get());
renderer.write(TestUtils::getTestOutputDir(__FILE__) / "TestSvgToNodeConverter.png");
}