summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/quote-test.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/xml/quote-test.h b/src/xml/quote-test.h
index 7f5372844..cfcb3bef2 100644
--- a/src/xml/quote-test.h
+++ b/src/xml/quote-test.h
@@ -1,4 +1,5 @@
#include <cxxtest/TestSuite.h>
+#include "streq.h"
/* Initial author: Peter Moulder.
Hereby released into the Public Domain. */
@@ -11,15 +12,6 @@
#define's and `using' directives of the included file. */
#include "quote.cpp"
-struct streq_free2 {
- bool operator()(char const *exp, char *got) const
- {
- bool const ret = (strcmp(exp, got) == 0);
- g_free(got);
- return ret;
- }
-};
-
class XmlQuoteTest : public CxxTest::TestSuite
{
public:
@@ -71,7 +63,9 @@ public:
{"a\"b<c>d;!@#$%^*(\\)?", "a&quot;b&lt;c&gt;d;!@#$%^*(\\)?"}
};
for(size_t i=0; i<G_N_ELEMENTS(cases); i++) {
- TS_ASSERT_RELATION( streq_free2, cases[i].s2, xml_quote_strdup(cases[i].s1) );
+ char* str = xml_quote_strdup(cases[i].s1);
+ TS_ASSERT_RELATION( streq_rel, cases[i].s2, str );
+ g_free(str);
}
}
};