This fork includes following fixes and enhancement for CPP and C
-
Support TSimpleJSONProtocol SimpleJSON is more commonly used by outside of Apache Thrift. Java already have this support, here I added for CPP.
-
TPlistProtocol Plist is Apple's configuration file format, eg: .mobileconfig. This feature can be useful for MDM vendors to generate profiles for iOS, MacOS, etc.
-
Fix issue where c glib binary protocol may goes to infinite loop in data fuzzy testing.
- Follow build instruction in README.md.orig
- Build exampe/ cd example make
- Run example ./example.exe
Here is example output:
----- TestSimpleJSONWrite() -----
{"commonField1":"Field1-value","commonField2":["Field2-value1","Field2-value2"],"commonField3":"aGVsbG8sd29ybGQ","commonField4":true,"commonField6":1.732,"commonField7":1732}
----- TestSimpleJSONRead() -----
{
"commonField1":"Field1",
"commonField2":["Field2-value1","Field2-value2"],
"commonField3":"aGVsbG8sd29ybGQ",
"commonField4":true,
"commonField6":1.732,
"commonField7":1732
}
Field1
Field2-value1
Field2-value2
hello,world
1
1.732
1732
----- TestPlistWrite() -----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>commonField1</key> <string>Field1-"'<>&</string> <key>commonField2</key> <array><string>Field2-value1</string> <string>Field2-value2</string></array> <key>commonField3</key> <data>aGVsbG8sd29ybGQ</data> <key>commonField4</key> <true/> <key>commonField6</key> <real>1.732</real> <key>commonField7</key> <integer>1732</integer> <key>common-field8</key> <integer>32</integer> </dict></plist>
----- TestPlistRead() -----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commonField1</key>
<string>Field1-"'<>&</string>
<key>commonField2</key>
<array>
<string>Field2-value1</string>
<string>Field2-value2</string>
</array>
<key>commonField3</key>
<data>aGVsbG8sd29ybGQ</data>
<key>commonField4</key>
<true/>
<key>commonField6</key>
<real>1.732</real>
<key>commonField7</key>
<integer>1732</integer>
<key>common-field8</key>
<integer>32</integer>
</dict>
</plist>
Field1-"'<>&
Field2-value1
Field2-value2
hello,world
1
1.732
1732
32