From: ishmal Date: Mon, 29 May 2006 01:02:00 +0000 (+0000) Subject: add test for config X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bccb6da5bfeebb99b7eb73b6329371b4cd837ffd;p=inkscape.git add test for config --- diff --git a/src/pedro/work/test.cpp b/src/pedro/work/test.cpp index be0676ebc..f822ceca9 100644 --- a/src/pedro/work/test.cpp +++ b/src/pedro/work/test.cpp @@ -3,6 +3,7 @@ #include #include "pedroxmpp.h" +#include "pedroconfig.h" //######################################################################## //# T E S T @@ -140,9 +141,42 @@ bool doTest() return true; } + +bool configTest() +{ + printf("#################################\n"); + printf("## C o n f i g t e s t\n"); + printf("#################################\n"); + + Pedro::XmppConfig config; + + if (!config.readFile("pedro.ini")) + { + printf("could not read config file\n"); + return false; + } + + Pedro::DOMString str = config.toXmlBuffer(); + + printf("#################################\n"); + printf("%s\n", str.c_str()); + + if (!config.writeFile("pedro2.ini")) + { + printf("could not write config file\n"); + return false; + } + + + return true; + +}; + + + int main(int argc, char **argv) { - if (!doTest()) + if (!configTest()) return 1; return 0; }