quote-test.h revision 3d42594dff3dfffd4c9de80c743ee387b0e403f4
#include <cxxtest/TestSuite.h>
/* Initial author: Peter Moulder.
Hereby released into the Public Domain. */
#include <cstring>
#include <functional>
/* mental disclaims all responsibility for this evil idea for testing
static functions. The main disadvantages are that we retain any
#define's and `using' directives of the included file. */
#include "quote.cpp"
struct streq_free2 {
{
return ret;
}
};
{
{
}
virtual ~XmlQuoteTest() {}
// createSuite and destroySuite get us per-suite setup and teardown
// without us having to worry about static initialization order, etc.
void testXmlQuotedStrlen()
{
struct {
char const *s;
} cases[] = {
{"", 0},
{"x", 1},
{"Foo", 3},
{"\"", 6},
{"&", 5},
{"<", 4},
{">", 4},
{"a\"b", 8},
{"a\"b<c>d;!@#$%^*(\\)?", 30}
};
}
}
void testXmlQuoteStrdup()
{
struct {
char const * s1;
char const * s2;
} cases[] = {
{"", ""},
{"x", "x"},
{"Foo", "Foo"},
{"\"", """},
{"&", "&"},
{"<", "<"},
{">", ">"},
{"a\"b<c>d;!@#$%^*(\\)?", "a"b<c>d;!@#$%^*(\\)?"}
};
}
}
};
/*
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 :