svg-length-test.h revision 741dec82d06d12a1c8cbe2baf7a9b9437b5ddec5
#include <cxxtest/TestSuite.h>
#include "svg/svg-length.h"
#include <glib.h>
#include <utility>
// function internal to svg-length.cpp:
{
struct test_t {
};
static char const * fail_tests[8];
SvgLengthTest() {
}
// createSuite and destroySuite get us per-suite setup and teardown
// without us having to worry about static initialization order, etc.
void testRead()
{
SVGLength l;
}
SVGLength l;
}
SVGLength l;
}
}
void testReadOrUnset()
{
SVGLength l;
}
SVGLength l;
}
SVGLength l;
}
}
void testReadAbsolute()
{
SVGLength l;
}
SVGLength l;
}
SVGLength l;
}
}
void testEnumMappedToString()
{
for ( int i = (static_cast<int>(SVGLength::NONE) + 1); i <= static_cast<int>(SVGLength::LAST_UNIT); i++ ) {
// PX is a special case where we don't have a unit string
}
}
}
// Ensure that all unit suffix strings used are allowed by SVG
void testStringsAreValidSVG()
{
for ( int i = (static_cast<int>(SVGLength::NONE) + 1); i <= static_cast<int>(SVGLength::LAST_UNIT); i++ ) {
}
}
// Ensure that all unit suffix strings allowed by SVG are covered by enum
void testValidSVGStringsSupported()
{
// Note that "px" is ommitted from the list, as it will be assumed to be so if not explicitly set.
for ( int i = (static_cast<int>(SVGLength::NONE) + 1); i <= static_cast<int>(SVGLength::LAST_UNIT); i++ ) {
}
}
}
// TODO: More tests
};
{"1.2345678mm", SVGLength::MM , 1.2345678, 1.2345678*3.543307}, // TODO: More precise constants? (a 7 digit constant when the default precision is 8 digits?)
"123 px",
"123e",
"123e+m",
"123ec",
"123pxt",
"--123",
"",
"px"};
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :