From: ishmal Date: Thu, 1 May 2008 19:54:27 +0000 (+0000) Subject: Rearrange tests. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d9a3c800148fdd07e0291f4e3248f6af183d470d;p=inkscape.git Rearrange tests. --- diff --git a/src/dom/cssreader.cpp b/src/dom/cssreader.cpp index 265881781..4bbcefb98 100644 --- a/src/dom/cssreader.cpp +++ b/src/dom/cssreader.cpp @@ -1643,26 +1643,41 @@ bool CssReader::parseFile(const DOMString &fileName) } // namespace org -#ifdef TEST +#ifdef CSSTEST -int main(int argc, char **argv) +static const char *fileNames[] = + { + "001.css", + "acid.css", + "base.css", + "inkscape.css", + "meyerweb.css", + NULL + }; + +bool doTests() { org::w3c::dom::css::CssReader parser; - char *fileName; - fileName = "001.css"; - //fileName = "acid.css"; - //fileName = "base.css"; - //fileName = "inkscape.css"; - //fileName = "meyerweb.css"; - if (!parser.parseFile(fileName)) - { - printf("Test failed\n"); + for (char **fname = (char **)fileNames ; *fname ; fname++) + { + DOMString fileName = *fname; + if (!parser.parseFile(fileName)) + { + printf("Test failed\n"); + return false; + } + } + return true; +} + +int main(int argc, char **argv) +{ + if (!doTests()) return 1; - } return 0; } -#endif /* TEST */ +#endif /* CSSTEST */ //######################################################################### //# E N D O F F I L E