svg-length-test.h revision 6ca0871243b23287418bed8719580f652f45f06b
#include <cxxtest/TestSuite.h>
#include "svg/svg-length.h"
#include <glib.h>
#include <utility>
// function internal to svg-length.cpp:
{
struct test_t {
};
struct testd_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()
{
}
}
}
}
void testReadOrUnset()
{
}
}
}
}
void testReadAbsolute()
{
}
}
}
}
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++ ) {
}
}
}
void testPlaces()
{
{"760", 761.92918978947023, 2, -8},
{"761.9", 761.92918978947023, 4, -8},
};
char buf[256] = {0};
unsigned int retval = sp_svg_number_write_de( buf, sizeof(buf), precTests[i].val, precTests[i].prec, precTests[i].minexp );
}
}
// TODO: More tests
};
{"1.2345678mm", SVGLength::MM , 1.2345678, 1.2345678f*96.0/25.4}, // TODO: More precise constants? (a 7 digit constant when the default precision is 8 digits?)
{"123.45678cm", SVGLength::CM , 123.45678 , 123.45678f*96.0/2.54}, // Note that svg_length_read is casting the result from g_ascii_strtod to float.
"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:fileencoding=utf-8:textwidth=99 :