Compare commits

..

12 Commits

Author SHA1 Message Date
Niels
15925469c6 Travis updated their Xcode 2016-09-11 22:50:40 +02:00
Niels
f922426ec3 fixed #304 2016-09-11 22:40:51 +02:00
Niels
2daab5a4c2 fixed #306 2016-09-11 22:30:08 +02:00
Niels
8ea0ee502d clang 3.9.0 is not working yet 2016-09-03 13:08:17 +02:00
Niels
fa0299f03a moved cmake into clang 2016-09-03 12:30:10 +02:00
Niels
36745ed296 install from tarball 2016-09-03 10:34:52 +02:00
Niels
f0455b401d forgot sh call 2016-09-03 09:44:10 +02:00
Niels
e0d809312b the cmake in apt is too old 2016-09-03 09:17:30 +02:00
Niels
bfd6678800 clang 3.9.0 needs a newer cmake 2016-09-03 08:47:07 +02:00
Niels
9639f0dfb3 Clang 3.9.0 has been released 2016-09-03 00:37:45 +02:00
Niels
357baeff5a release 2.0.3 2016-09-01 08:07:52 +02:00
Niels
42be2edd4c fixed test coverage 2016-09-01 00:29:42 +02:00
10 changed files with 54 additions and 6 deletions

View File

@@ -213,6 +213,10 @@ install:
if [[ "${LLVM_VERSION}" != "" ]]; then
LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
travis_retry wget --quiet https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz
tar xfz cmake-3.6.1.tar.gz
(cd cmake-3.6.1 && ./configure --prefix=${LLVM_DIR}/cmake && make install)
export PATH="${LLVM_DIR}/cmake/bin:${PATH}"
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"

View File

@@ -430,7 +430,7 @@ The following compilers are currently used in continuous integration at [Travis]
| Clang Xcode 7.1 | Darwin Kernel Version 14.5.0 (OSX 10.10.5) | Apple LLVM version 7.0.0 (clang-700.1.76) |
| Clang Xcode 7.2 | Darwin Kernel Version 15.0.0 (OSX 10.10.5) | Apple LLVM version 7.0.2 (clang-700.1.81) |
| Clang Xcode 7.3 | Darwin Kernel Version 15.0.0 (OSX 10.10.5) | Apple LLVM version 7.3.0 (clang-703.0.29) |
| Clang Xcode 8.0 | Darwin Kernel Version 15.5.0 (OSX 10.11.5) | Apple LLVM version 8.0.0 (clang-800.0.24.1) |
| Clang Xcode 8.0 | Darwin Kernel Version 15.6.0 (OSX 10.11.6) | Apple LLVM version 8.0.0 (clang-800.0.38) |
| Visual Studio 14 2015 | Windows Server 2012 R2 (x64) | Microsoft (R) Build Engine version 14.0.25123.0 |
@@ -512,7 +512,7 @@ To compile and run the tests, you need to execute
$ make check
===============================================================================
All tests passed (8905154 assertions in 35 test cases)
All tests passed (8905158 assertions in 35 test cases)
```
For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml).

BIN
doc/images/scanner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 KiB

After

Width:  |  Height:  |  Size: 440 KiB

View File

@@ -8592,7 +8592,7 @@ basic_json_parser_63:
const auto offset_cursor = m_cursor - m_start;
// no stream is used or end of file is reached
if (m_stream == nullptr or not * m_stream)
if (m_stream == nullptr or m_stream->eof())
{
// copy unprocessed characters to line buffer
m_line_buffer.clear();
@@ -10116,7 +10116,7 @@ basic_json_parser_63:
json_pointer top_pointer = ptr.top();
if (top_pointer != ptr)
{
basic_json& x = result.at(top_pointer);
result.at(top_pointer);
}
// get reference to parent of JSON pointer ptr

View File

@@ -7889,7 +7889,7 @@ class basic_json
const auto offset_cursor = m_cursor - m_start;
// no stream is used or end of file is reached
if (m_stream == nullptr or not * m_stream)
if (m_stream == nullptr or m_stream->eof())
{
// copy unprocessed characters to line buffer
m_line_buffer.clear();
@@ -9413,7 +9413,7 @@ class basic_json
json_pointer top_pointer = ptr.top();
if (top_pointer != ptr)
{
basic_json& x = result.at(top_pointer);
result.at(top_pointer);
}
// get reference to parent of JSON pointer ptr

View File

@@ -0,0 +1 @@
{"AmbientOcclusion":false,"AnisotropicFiltering":16,"FOV":90,"FullScreen":true,"MipmapLevel":4,"RenderDistance":4,"VSync":true,"WindowResX":1920,"WindowResY":1080}

View File

@@ -0,0 +1 @@
{"AmbientOcclusion":false,"AnisotropicFiltering":16,"FOV":90,"FullScreen":true,"MipmapLevel":4,"RenderDistance":4,"VSync":true,"WindowResX":1920,"WindowResY":1080}

View File

@@ -223,5 +223,21 @@ TEST_CASE("deserialization")
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument);
}
}
// these cases are required for 100% line coverage
SECTION("error cases")
{
SECTION("case 1")
{
uint8_t v[] = {'\"', 'a', 'a', 'a', 'a', 'a', 'a', '\\', 'u'};
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument);
}
SECTION("case 2")
{
uint8_t v[] = {'\"', 'a', 'a', 'a', 'a', 'a', 'a', '\\', 'u', '1'};
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), std::invalid_argument);
}
}
}
}

View File

@@ -31,6 +31,8 @@ SOFTWARE.
#include "json.hpp"
using nlohmann::json;
#include <fstream>
TEST_CASE("regression tests")
{
SECTION("issue #60 - Double quotation mark is not parsed correctly")
@@ -440,4 +442,28 @@ TEST_CASE("regression tests")
CHECK(at_integer == val_integer);
}
SECTION("issue #304 - Unused variable warning")
{
// code triggered a "warning: unused variable" warning and is left
// here to avoid the warning in the future
json object;
json patch = json::array();
object = object.patch(patch);
}
SECTION("issue #306 - Parsing fails without space at end of file")
{
for (auto filename :
{
"test/data/regression/broken_file.json",
"test/data/regression/working_file.json"
})
{
CAPTURE(filename);
json j;
std::ifstream f(filename);
CHECK_NOTHROW(j << f);
}
}
}