diff --git a/.travis.yml b/.travis.yml
index bd806cb89..1325e43e3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b2d54c4a..c7d96630d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
# define the project
-project(nlohmann_json VERSION 2.0.3 LANGUAGES CXX)
+project(nlohmann_json VERSION 2.0.4 LANGUAGES CXX)
enable_testing()
diff --git a/ChangeLog.md b/ChangeLog.md
index dd1b37966..003eec7ba 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,6 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
+## [v2.0.4](https://github.com/nlohmann/json/releases/tag/v2.0.4) (2016-09-11)
+[Full Changelog](https://github.com/nlohmann/json/compare/v2.0.3...v2.0.4)
+
+- Parsing fails without space at end of file [\#306](https://github.com/nlohmann/json/issues/306)
+
+- Unused variable warning [\#304](https://github.com/nlohmann/json/issues/304)
+
## [v2.0.3](https://github.com/nlohmann/json/releases/tag/v2.0.3) (2016-08-31)
[Full Changelog](https://github.com/nlohmann/json/compare/v2.0.2...v2.0.3)
diff --git a/README.md b/README.md
index 1c62e1374..0bba68b1f 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[](https://travis-ci.org/nlohmann/json)
[](https://ci.appveyor.com/project/nlohmann/json)
[](https://coveralls.io/r/nlohmann/json)
-[](http://melpon.org/wandbox/permlink/zkFPohcXJ2TFuAyq)
+[](http://melpon.org/wandbox/permlink/MN72DYughLUXjVLk)
[](http://nlohmann.github.io/json)
[](https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT)
[](https://github.com/nlohmann/json/releases)
@@ -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).
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 17cbd1a3e..e1d5d558b 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "JSON for Modern C++"
-PROJECT_NUMBER = 2.0.3
+PROJECT_NUMBER = 2.0.4
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = .
diff --git a/doc/examples/README.link b/doc/examples/README.link
index a2d8a68ca..4e56769c2 100644
--- a/doc/examples/README.link
+++ b/doc/examples/README.link
@@ -1 +1 @@
-online
\ No newline at end of file
+online
\ No newline at end of file
diff --git a/doc/index.md b/doc/index.md
index ba62dfab4..68bcf86c1 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -268,4 +268,4 @@ The container functions known from STL have been extended to support the differe
@author [Niels Lohmann](http://nlohmann.me)
@see https://github.com/nlohmann/json to download the source code
-@version 2.0.3
+@version 2.0.4
diff --git a/doc/json.gif b/doc/json.gif
index cc2a9726d..f49cf02fb 100644
Binary files a/doc/json.gif and b/doc/json.gif differ
diff --git a/src/json.hpp b/src/json.hpp
index 25a9dbcf7..fd548c2c9 100644
--- a/src/json.hpp
+++ b/src/json.hpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
@@ -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
diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index 7ca046eaf..dd603f042 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
@@ -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
diff --git a/test/data/regression/broken_file.json b/test/data/regression/broken_file.json
new file mode 100644
index 000000000..622d51ede
--- /dev/null
+++ b/test/data/regression/broken_file.json
@@ -0,0 +1 @@
+{"AmbientOcclusion":false,"AnisotropicFiltering":16,"FOV":90,"FullScreen":true,"MipmapLevel":4,"RenderDistance":4,"VSync":true,"WindowResX":1920,"WindowResY":1080}
\ No newline at end of file
diff --git a/test/data/regression/working_file.json b/test/data/regression/working_file.json
new file mode 100644
index 000000000..87436c205
--- /dev/null
+++ b/test/data/regression/working_file.json
@@ -0,0 +1 @@
+{"AmbientOcclusion":false,"AnisotropicFiltering":16,"FOV":90,"FullScreen":true,"MipmapLevel":4,"RenderDistance":4,"VSync":true,"WindowResX":1920,"WindowResY":1080}
\ No newline at end of file
diff --git a/test/src/fuzz.cpp b/test/src/fuzz.cpp
index 221faaae3..11f2c351a 100644
--- a/test/src/fuzz.cpp
+++ b/test/src/fuzz.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (fuzz test support)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Run "make fuzz_testing" and follow the instructions.
diff --git a/test/src/unit-algorithms.cpp b/test/src/unit-algorithms.cpp
index 4d9d90a14..abca8bec0 100644
--- a/test/src/unit-algorithms.cpp
+++ b/test/src/unit-algorithms.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-allocator.cpp b/test/src/unit-allocator.cpp
index 9176b6dab..9c989d760 100644
--- a/test/src/unit-allocator.cpp
+++ b/test/src/unit-allocator.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-capacity.cpp b/test/src/unit-capacity.cpp
index 5560ed1fb..56c5fb5fc 100644
--- a/test/src/unit-capacity.cpp
+++ b/test/src/unit-capacity.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-class_const_iterator.cpp b/test/src/unit-class_const_iterator.cpp
index eceaa0029..28d88ee4e 100644
--- a/test/src/unit-class_const_iterator.cpp
+++ b/test/src/unit-class_const_iterator.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-class_iterator.cpp b/test/src/unit-class_iterator.cpp
index 1fb7deb19..21cca451b 100644
--- a/test/src/unit-class_iterator.cpp
+++ b/test/src/unit-class_iterator.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-class_lexer.cpp b/test/src/unit-class_lexer.cpp
index 27a67fe79..76c2f6851 100644
--- a/test/src/unit-class_lexer.cpp
+++ b/test/src/unit-class_lexer.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-class_parser.cpp b/test/src/unit-class_parser.cpp
index 1c23df574..16e4049d3 100644
--- a/test/src/unit-class_parser.cpp
+++ b/test/src/unit-class_parser.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-comparison.cpp b/test/src/unit-comparison.cpp
index fa5a9ac86..f17f6a499 100644
--- a/test/src/unit-comparison.cpp
+++ b/test/src/unit-comparison.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-concepts.cpp b/test/src/unit-concepts.cpp
index acd787521..00e1ac021 100644
--- a/test/src/unit-concepts.cpp
+++ b/test/src/unit-concepts.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-constructor1.cpp b/test/src/unit-constructor1.cpp
index 6815db651..a42eb2ea3 100644
--- a/test/src/unit-constructor1.cpp
+++ b/test/src/unit-constructor1.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-constructor2.cpp b/test/src/unit-constructor2.cpp
index 17c538984..789f19d6d 100644
--- a/test/src/unit-constructor2.cpp
+++ b/test/src/unit-constructor2.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-convenience.cpp b/test/src/unit-convenience.cpp
index f5c6f07d4..9ec5c741e 100644
--- a/test/src/unit-convenience.cpp
+++ b/test/src/unit-convenience.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp
index 592dcf0ab..4028b1c09 100644
--- a/test/src/unit-conversions.cpp
+++ b/test/src/unit-conversions.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-deserialization.cpp b/test/src/unit-deserialization.cpp
index 01441b1af..973893aa8 100644
--- a/test/src/unit-deserialization.cpp
+++ b/test/src/unit-deserialization.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-element_access1.cpp b/test/src/unit-element_access1.cpp
index d32b3f808..13ad0e9d9 100644
--- a/test/src/unit-element_access1.cpp
+++ b/test/src/unit-element_access1.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-element_access2.cpp b/test/src/unit-element_access2.cpp
index fe53ddd7a..a83b49bc9 100644
--- a/test/src/unit-element_access2.cpp
+++ b/test/src/unit-element_access2.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-inspection.cpp b/test/src/unit-inspection.cpp
index d99241b69..8eaf843d1 100644
--- a/test/src/unit-inspection.cpp
+++ b/test/src/unit-inspection.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-iterator_wrapper.cpp b/test/src/unit-iterator_wrapper.cpp
index df358282f..3d98323f2 100644
--- a/test/src/unit-iterator_wrapper.cpp
+++ b/test/src/unit-iterator_wrapper.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-iterators1.cpp b/test/src/unit-iterators1.cpp
index c33791d25..1982a1c4c 100644
--- a/test/src/unit-iterators1.cpp
+++ b/test/src/unit-iterators1.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-iterators2.cpp b/test/src/unit-iterators2.cpp
index 1354ad0fc..347bc363f 100644
--- a/test/src/unit-iterators2.cpp
+++ b/test/src/unit-iterators2.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-json_patch.cpp b/test/src/unit-json_patch.cpp
index 5f7ea36d6..1103a2abd 100644
--- a/test/src/unit-json_patch.cpp
+++ b/test/src/unit-json_patch.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-json_pointer.cpp b/test/src/unit-json_pointer.cpp
index d73d801ad..5c74fd716 100644
--- a/test/src/unit-json_pointer.cpp
+++ b/test/src/unit-json_pointer.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-modifiers.cpp b/test/src/unit-modifiers.cpp
index 7b2443271..9e52d7f71 100644
--- a/test/src/unit-modifiers.cpp
+++ b/test/src/unit-modifiers.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-pointer_access.cpp b/test/src/unit-pointer_access.cpp
index 2b33e64da..04964855b 100644
--- a/test/src/unit-pointer_access.cpp
+++ b/test/src/unit-pointer_access.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-readme.cpp b/test/src/unit-readme.cpp
index 8fc7886ff..5f7435647 100644
--- a/test/src/unit-readme.cpp
+++ b/test/src/unit-readme.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-reference_access.cpp b/test/src/unit-reference_access.cpp
index 30a0dea64..373e9818d 100644
--- a/test/src/unit-reference_access.cpp
+++ b/test/src/unit-reference_access.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp
index f61595a90..7df1e7fcb 100644
--- a/test/src/unit-regression.cpp
+++ b/test/src/unit-regression.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
@@ -31,6 +31,8 @@ SOFTWARE.
#include "json.hpp"
using nlohmann::json;
+#include
+
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);
+ }
+ }
}
diff --git a/test/src/unit-serialization.cpp b/test/src/unit-serialization.cpp
index 6b9eed22d..700e1642d 100644
--- a/test/src/unit-serialization.cpp
+++ b/test/src/unit-serialization.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-testsuites.cpp b/test/src/unit-testsuites.cpp
index 1ef2b97d6..49d2b156b 100644
--- a/test/src/unit-testsuites.cpp
+++ b/test/src/unit-testsuites.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit-unicode.cpp b/test/src/unit-unicode.cpp
index a8fbaf960..4ac406b6d 100644
--- a/test/src/unit-unicode.cpp
+++ b/test/src/unit-unicode.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .
diff --git a/test/src/unit.cpp b/test/src/unit.cpp
index 57ebc3ef3..56578523c 100644
--- a/test/src/unit.cpp
+++ b/test/src/unit.cpp
@@ -1,7 +1,7 @@
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (test suite)
-| | |__ | | | | | | version 2.0.3
+| | |__ | | | | | | version 2.0.4
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License .