flavio / qjson

QJson is a qt-based library that maps JSON data to QVariant objects.
http://qjson.sourceforge.net
GNU Lesser General Public License v2.1
287 stars 140 forks source link

considers empty file as valid #41

Closed svuorela closed 10 years ago

svuorela commented 10 years ago

An empty file or empty QByteArray gets parsed as valid json.

According to json specs, a piece of json needs to have an object or an array.

Adding a line like

QTest::newRow("no data") << QByteArray("");

to

void TestParser::parseInvalidObject_data() 

makes the test fail. I would expect it to pass.

flavio commented 10 years ago

Fixed with 0b7a5858f937672859616666ba5add736931a2e1