test/unittests/simplefeaturecollections/points.cpp
//representative for all featurecollections, as serialization of metadata is done identically
representative for all featurecollections, as serialization of metadata is done identically
representative for all featurecollections as serialization of metadata is done identically
TEST(PointCollection, toGeoJSONStringEscaping) {
	PointCollection points(SpatioTemporalReference::unreferenced());
	auto &test = points.feature_attributes.addTextualAttribute("test", Unit::unknown());
	points.addCoordinate(1,2);
	points.finishFeature();
	test.set(0, "Simple \\nTest \" of ,.;:--//\t\0 symbols");
	Json::Reader reader(Json::Features::strictMode());
	Json::Value root;
	std::istringstream iss(points.toGeoJSON(true));
	bool success = reader.parse(iss, root);
	EXPECT_EQ(true, success);
}
TEST ( PointCollection , toGeoJSONStringEscaping ) { PointCollection points ( SpatioTemporalReference :: unreferenced ( ) ) ; auto & test = points . feature_attributes . addTextualAttribute ( " " , Unit :: unknown ( ) ) ; points . addCoordinate ( 1 , 2 ) ; points . finishFeature ( ) ; test . set ( 0 , " \\ \" \t \0 " ) ; Json :: Reader reader ( Json :: Features :: strictMode ( ) ) ; Json :: Value root ; std :: istringstream iss ( points . toGeoJSON ( true ) ) ; bool success = reader . parse ( iss , root ) ; EXPECT_EQ ( true , success ) ; }
representative for all featurecollections, as serialization of metadata is done identically
representative for all featurecollections as serialization of metadata is done identically