#include "SvgWriter.h" #include "SvgDocument.h" #include "SvgShapeElements.h" #include "File.h" #include "TestFramework.h" #include "TestUtils.h" TEST_CASE(TestSvgWriter, "web") { auto document = std::make_unique(); document->setViewBox(0, 0, 100, 100); auto circle = std::make_unique(); circle->setRadius(20); circle->setLocation({10, 30}); circle->setFill({255, 0, 0}); document->getRoot()->addChild(std::move(circle)); auto rectangle = std::make_unique(); rectangle->setLocation({50, 70}); rectangle->setWidth(5); rectangle->setHeight(10); rectangle->setFill({0, 0, 255}); document->getRoot()->addChild(std::move(rectangle)); SvgWriter writer; auto content = writer.toString(document.get()); auto outFile = std::make_unique(TestUtils::getTestOutputDir(__FILE__) / "test_out.svg"); outFile->writeText(content); }