mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-27 00:35:23 +01:00
clang build fixes
This commit is contained in:
parent
09c7fc0fa0
commit
102413aed5
@ -13,14 +13,6 @@
|
||||
#include "JSONTest.h"
|
||||
#include "CppUnit/TestCaller.h"
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/JSON/Object.h"
|
||||
#include "Poco/JSON/Parser.h"
|
||||
#include "Poco/JSON/Query.h"
|
||||
#include "Poco/JSON/JSONException.h"
|
||||
#include "Poco/JSON/Stringifier.h"
|
||||
#include "Poco/JSON/ParseHandler.h"
|
||||
#include "Poco/JSON/PrintHandler.h"
|
||||
#include "Poco/JSON/Template.h"
|
||||
#include "Poco/Path.h"
|
||||
#include "Poco/Environment.h"
|
||||
#include "Poco/File.h"
|
||||
|
@ -18,6 +18,15 @@
|
||||
|
||||
#include "Poco/JSON/JSON.h"
|
||||
#include "CppUnit/TestCase.h"
|
||||
#include "Poco/JSON/Object.h"
|
||||
#include "Poco/JSON/Parser.h"
|
||||
#include "Poco/JSON/Query.h"
|
||||
#include "Poco/JSON/JSONException.h"
|
||||
#include "Poco/JSON/Stringifier.h"
|
||||
#include "Poco/JSON/ParseHandler.h"
|
||||
#include "Poco/JSON/PrintHandler.h"
|
||||
#include "Poco/JSON/Template.h"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
class JSONTest: public CppUnit::TestCase
|
||||
@ -83,33 +92,33 @@ private:
|
||||
std::ostringstream os;
|
||||
os << "{ \"test\" : " << number << " }";
|
||||
std::string json = os.str();
|
||||
Parser parser;
|
||||
Var result;
|
||||
Poco::JSON::Parser parser;
|
||||
Poco::Dynamic::Var result;
|
||||
|
||||
try
|
||||
{
|
||||
result = parser.parse(json);
|
||||
}
|
||||
catch (JSONException& jsone)
|
||||
catch (Poco::JSON::JSONException& jsone)
|
||||
{
|
||||
std::cout << jsone.message() << std::endl;
|
||||
assert(false);
|
||||
}
|
||||
|
||||
assert(result.type() == typeid(Object::Ptr));
|
||||
assert(result.type() == typeid(Poco::JSON::Object::Ptr));
|
||||
|
||||
Object::Ptr object = result.extract<Object::Ptr>();
|
||||
Var test = object->get("test");
|
||||
Poco::JSON::Object::Ptr object = result.extract<Poco::JSON::Object::Ptr>();
|
||||
Poco::Dynamic::Var test = object->get("test");
|
||||
assert(test.isNumeric());
|
||||
T value = test;
|
||||
assert(value == number);
|
||||
|
||||
DynamicStruct ds = *object;
|
||||
Poco::DynamicStruct ds = *object;
|
||||
assert(!ds["test"].isEmpty());
|
||||
assert(ds["test"].isNumeric());
|
||||
assert(ds["test"] == number);
|
||||
|
||||
const DynamicStruct& rds = *object;
|
||||
const Poco::DynamicStruct& rds = *object;
|
||||
assert(!rds["test"].isEmpty());
|
||||
assert(rds["test"].isNumeric());
|
||||
assert(rds["test"] == number);
|
||||
|
Loading…
x
Reference in New Issue
Block a user