esvg/test/testPolygon.cpp

37 lines
1.2 KiB
C++
Raw Normal View History

/**
* @author Edouard DUPIN
*
* @copyright 2014, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
*/
#include <gtest/gtest.h>
#include <esvg/esvg.h>
TEST(TestPolygon, fill) {
esvg::Document doc;
doc.parse( "<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"
" <polygon points='50,10 90,50 10,80' fill='red' />"
"</svg>");
doc.generateAnImage(ivec2(100, 100), "TestPolygon_fill.ppm");
}
TEST(TestPolygon, stroke) {
esvg::Document doc;
doc.parse( "<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"
" <polygon points='50,10 90,50 10,80' stroke='green' stroke-width='3' />"
"</svg>");
doc.generateAnImage(ivec2(100, 100), "TestPolygon_stroke.ppm");
}
TEST(TestPolygon, fill_and_stroke) {
esvg::Document doc;
doc.parse( "<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
"<svg height='100' width='100'>"
" <polygon points='50,10 90,50 10,80' stroke='green' stroke-width='3' fill='red' />"
"</svg>");
doc.generateAnImage(ivec2(100, 100), "TestPolygon_fill_and_stroke.ppm");
}