From bccb6da5bfeebb99b7eb73b6329371b4cd837ffd Mon Sep 17 00:00:00 2001 From: ishmal Date: Mon, 29 May 2006 01:02:00 +0000 Subject: [PATCH] add test for config --- src/pedro/work/test.cpp | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) 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; } -- 2.30.2