first commit
This commit is contained in:
53
test/TestXml.cpp
Normal file
53
test/TestXml.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
// TestXml.cpp : Test XML encoding and decoding.
|
||||
|
||||
// The characters <>&'" are illegal in xml and must be encoded.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// If you are using MSVC++6, you should update <string> to fix
|
||||
|
||||
// BUG: getline Template Function Reads Extra Character
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
||||
#include "XmlRpcUtil.h"
|
||||
|
||||
|
||||
|
||||
using namespace XmlRpc;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
||||
{
|
||||
|
||||
// Basic tests
|
||||
|
||||
std::string empty;
|
||||
|
||||
assert(empty == XmlRpcUtil::xmlEncode(empty));
|
||||
|
||||
assert(empty == XmlRpcUtil::xmlDecode(empty));
|
||||
|
||||
assert(empty == XmlRpcUtil::xmlEncode(""));
|
||||
|
||||
assert(empty == XmlRpcUtil::xmlDecode(""));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user