1
#include <cxxtest/TestSuite.h>
4
/* Initial author: Peter Moulder.
5
Hereby released into the Public Domain. */
10
/* mental disclaims all responsibility for this evil idea for testing
11
static functions. The main disadvantages are that we retain any
12
#define's and `using' directives of the included file. */
15
class XmlQuoteTest : public CxxTest::TestSuite
22
virtual ~XmlQuoteTest() {}
24
// createSuite and destroySuite get us per-suite setup and teardown
25
// without us having to worry about static initialization order, etc.
26
static XmlQuoteTest *createSuite() { return new XmlQuoteTest(); }
27
static void destroySuite( XmlQuoteTest *suite ) { delete suite; }
29
void testXmlQuotedStrlen()
43
{"a\"b<c>d;!@#$%^*(\\)?", 30}
45
for(size_t i=0; i<G_N_ELEMENTS(cases); i++) {
46
TS_ASSERT_EQUALS( xml_quoted_strlen(cases[i].s) , cases[i].len );
50
void testXmlQuoteStrdup()
63
{"a\"b<c>d;!@#$%^*(\\)?", "a"b<c>d;!@#$%^*(\\)?"}
65
for(size_t i=0; i<G_N_ELEMENTS(cases); i++) {
66
char* str = xml_quote_strdup(cases[i].s1);
67
TS_ASSERT_RELATION( streq_rel, cases[i].s2, str );
76
c-file-style:"stroustrup"
77
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
82
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :