/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Utilities/JobInfoSvc/JobInfoSvc-00-00-02/xmlrpc++0.7/test/TestXml.cpp File Reference

#include <iostream>
#include <string>
#include <assert.h>
#include <stdlib.h>
#include "XmlRpcUtil.h"

Go to the source code of this file.

Defines

#define WIN32_LEAN_AND_MEAN

Functions

int main (int argc, char *argv[])


Define Documentation

#define WIN32_LEAN_AND_MEAN

Definition at line 5 of file TestXml.cpp.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 19 of file TestXml.cpp.

References s, and deljobs::string.

00020 {
00021   // Basic tests
00022   std::string empty;
00023   assert(empty == XmlRpcUtil::xmlEncode(empty));
00024   assert(empty == XmlRpcUtil::xmlDecode(empty));
00025   assert(empty == XmlRpcUtil::xmlEncode(""));
00026   assert(empty == XmlRpcUtil::xmlDecode(""));
00027 
00028   std::string raw("<>&'\"");
00029   assert(XmlRpcUtil::xmlDecode(XmlRpcUtil::xmlEncode(raw)) == raw);
00030   
00031   std::cout << "Basic tests passed.\n";
00032 
00033   // Interactive tests
00034   std::string s;
00035   for (;;) {
00036     std::cout << "\nEnter line of raw text to encode:\n";
00037     std::getline(std::cin, s);
00038     if (s.empty()) break;
00039 
00040     std::cout << XmlRpcUtil::xmlEncode(s) << std::endl;
00041   }
00042 
00043   for (;;) {
00044     std::cout << "\nEnter line of xml-encoded text to decode:\n";
00045     std::getline(std::cin, s);
00046     if (s.empty()) break;
00047 
00048     std::cout << XmlRpcUtil::xmlDecode(s) << std::endl;
00049   }
00050 
00051   return 0;
00052 }


Generated on Tue Nov 29 23:17:21 2016 for BOSS_7.0.2 by  doxygen 1.4.7