diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2008-12-09 00:06:13 +0000 |
|---|---|---|
| committer | tweenk <tweenk@users.sourceforge.net> | 2008-12-09 00:06:13 +0000 |
| commit | ed0c006e81c69fbed16181c512c55190d998892e (patch) | |
| tree | 37e6c6d558eceb3e7b4ac9f5ac3aaac41b854863 /src/xml/quote-test.cpp | |
| parent | fix for Bug #234305 (paste into transformed groups) (diff) | |
| download | inkscape-ed0c006e81c69fbed16181c512c55190d998892e.tar.gz inkscape-ed0c006e81c69fbed16181c512c55190d998892e.zip | |
Simplify "make check" makefile rules and remove most of the obsolete
utest-based tests.
(bzr r6976)
Diffstat (limited to 'src/xml/quote-test.cpp')
| -rw-r--r-- | src/xml/quote-test.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/xml/quote-test.cpp b/src/xml/quote-test.cpp deleted file mode 100644 index 197ca5309..000000000 --- a/src/xml/quote-test.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* Initial author: Peter Moulder. - Hereby released into the Public Domain. */ - -#include <cstring> -#include <functional> - -#include "utest/test-1ary-cases.h" - -/* 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 { - bool operator()(char const *exp, char *got) - { - bool const ret = (strcmp(exp, got) == 0); - g_free(got); - return ret; - } -}; - -static bool -test_xml_quoted_strlen() -{ - utest_start("xml_quoted_strlen"); - struct Case1<char const *, size_t> cases[] = { - {"", 0}, - {"x", 1}, - {"Foo", 3}, - {"\"", 6}, - {"&", 5}, - {"<", 4}, - {">", 4}, - {"a\"b", 8}, - {"a\"b<c>d;!@#$%^*(\\)?", 30} - }; - test_1ary_cases<size_t, char const *, size_t, std::equal_to<size_t> >("xml_quoted_strlen", - xml_quoted_strlen, - G_N_ELEMENTS(cases), - cases); - return utest_end(); -} - -static bool -test_xml_quote_strdup() -{ - utest_start("xml_quote_strdup"); - struct Case1<char const *, char const *> cases[] = { - {"", ""}, - {"x", "x"}, - {"Foo", "Foo"}, - {"\"", """}, - {"&", "&"}, - {"<", "<"}, - {">", ">"}, - {"a\"b<c>d;!@#$%^*(\\)?", "a"b<c>d;!@#$%^*(\\)?"} - }; - test_1ary_cases<char *, char const *, char const *, streq_free2>("xml_quote_strdup", - xml_quote_strdup, - G_N_ELEMENTS(cases), - cases); - return utest_end(); -} - -int main() { - bool const succ = (test_xml_quoted_strlen() - && test_xml_quote_strdup()); - return ( succ - ? EXIT_SUCCESS - : EXIT_FAILURE ); -} - - -/* - 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 : |
