mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-28 03:50:53 +08:00
Merge pull request #266 from cdunn2001/issue-252
Use unsigned for DuplicationPolicy, to fix a problem with "C++ Builder" IDE. Fixes #252. Thanks to: * Dan Liu -- http://blog.csdn.net/gzliudan/article/details/45264201) * Victor Chen -- http://www.cppfans.com/sdk/json/jsoncpp.asp
This commit is contained in:
commit
28d086e1d9
@ -211,7 +211,7 @@ private:
|
|||||||
void swap(CZString& other);
|
void swap(CZString& other);
|
||||||
|
|
||||||
struct StringStorage {
|
struct StringStorage {
|
||||||
DuplicationPolicy policy_: 2;
|
unsigned policy_: 2;
|
||||||
unsigned length_: 30; // 1GB max
|
unsigned length_: 30; // 1GB max
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -257,6 +257,20 @@ JSONTEST_FIXTURE(ValueTest, arrays) {
|
|||||||
JSONTEST_ASSERT_EQUAL(Json::Value(17), got);
|
JSONTEST_ASSERT_EQUAL(Json::Value(17), got);
|
||||||
JSONTEST_ASSERT_EQUAL(false, array1_.removeIndex(2, &got)); // gone now
|
JSONTEST_ASSERT_EQUAL(false, array1_.removeIndex(2, &got)); // gone now
|
||||||
}
|
}
|
||||||
|
JSONTEST_FIXTURE(ValueTest, arrayIssue252)
|
||||||
|
{
|
||||||
|
int count = 5;
|
||||||
|
Json::Value root;
|
||||||
|
Json::Value item;
|
||||||
|
root["array"] = Json::Value::nullRef;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
item["a"] = i;
|
||||||
|
item["b"] = i;
|
||||||
|
root["array"][i] = item;
|
||||||
|
}
|
||||||
|
//JSONTEST_ASSERT_EQUAL(5, root["array"].size());
|
||||||
|
}
|
||||||
|
|
||||||
JSONTEST_FIXTURE(ValueTest, null) {
|
JSONTEST_FIXTURE(ValueTest, null) {
|
||||||
JSONTEST_ASSERT_EQUAL(Json::nullValue, null_.type());
|
JSONTEST_ASSERT_EQUAL(Json::nullValue, null_.type());
|
||||||
@ -2326,6 +2340,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, memberCount);
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, memberCount);
|
||||||
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, objects);
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, objects);
|
||||||
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, arrays);
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, arrays);
|
||||||
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, arrayIssue252);
|
||||||
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, null);
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, null);
|
||||||
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, strings);
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, strings);
|
||||||
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, bools);
|
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, bools);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user