From 29024b356ea0a71f3742bae50c4748165381e062 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Sun, 19 Mar 2023 14:28:03 +0100 Subject: [PATCH] New ArduinoJson library New Synth_Dexed library Small fixes. --- UI.hpp | 1 + third-party/ArduinoJson/ArduinoJson.h | 2 +- third-party/ArduinoJson/CHANGELOG.md | 7 + third-party/ArduinoJson/CMakeLists.txt | 12 +- third-party/ArduinoJson/LICENSE.txt | 2 +- third-party/ArduinoJson/README.md | 15 +- third-party/ArduinoJson/appveyor.yml | 11 +- .../JsonConfigFile/JsonConfigFile.ino | 2 +- .../JsonFilterExample/JsonFilterExample.ino | 2 +- .../JsonGeneratorExample.ino | 2 +- .../JsonHttpClient/JsonHttpClient.ino | 2 +- .../JsonParserExample/JsonParserExample.ino | 2 +- .../examples/JsonServer/JsonServer.ino | 2 +- .../examples/JsonUdpBeacon/JsonUdpBeacon.ino | 2 +- .../examples/MsgPackParser/MsgPackParser.ino | 2 +- .../ProgmemExample/ProgmemExample.ino | 2 +- .../examples/StringExample/StringExample.ino | 2 +- .../ArduinoJson/extras/CompileOptions.cmake | 18 +- .../extras/ci/espidf/CMakeLists.txt | 2 +- .../extras/ci/espidf/main/CMakeLists.txt | 8 +- .../extras/ci/espidf/main/main.cpp | 2 +- .../ArduinoJson/extras/conf_test/avr.cpp | 2 +- .../ArduinoJson/extras/conf_test/esp8266.cpp | 2 +- .../ArduinoJson/extras/conf_test/x64.cpp | 2 +- .../ArduinoJson/extras/conf_test/x86.cpp | 2 +- .../ArduinoJson/extras/fuzzing/CMakeLists.txt | 25 +- .../ArduinoJson/extras/fuzzing/Makefile | 2 +- .../ArduinoJson/extras/fuzzing/reproducer.cpp | 2 +- .../extras/scripts/build-single-header.sh | 3 +- .../ArduinoJson/extras/scripts/publish.sh | 2 +- .../scripts/wandbox/JsonGeneratorExample.cpp | 2 +- .../scripts/wandbox/JsonParserExample.cpp | 2 +- .../scripts/wandbox/MsgPackParserExample.cpp | 2 +- .../ArduinoJson/extras/tests/CMakeLists.txt | 5 +- .../extras/tests/Cpp11/CMakeLists.txt | 36 - .../extras/tests/Cpp17/CMakeLists.txt | 4 +- .../extras/tests/Cpp17/string_view.cpp | 4 +- .../extras/tests/Cpp20/CMakeLists.txt | 4 +- .../extras/tests/FailingBuilds/CMakeLists.txt | 24 +- .../extras/tests/FailingBuilds/Issue1189.cpp | 2 +- .../extras/tests/FailingBuilds/Issue978.cpp | 2 +- .../tests/FailingBuilds/assign_char.cpp | 2 +- .../FailingBuilds/delete_jsondocument.cpp | 2 +- .../tests/FailingBuilds/read_long_long.cpp | 6 +- .../tests/FailingBuilds/variant_as_char.cpp | 2 +- .../tests/FailingBuilds/write_long_long.cpp | 6 +- .../extras/tests/Helpers/Arduino.h | 2 +- .../extras/tests/Helpers/CustomReader.hpp | 6 +- .../extras/tests/Helpers/api/Print.h | 2 +- .../extras/tests/Helpers/api/Stream.h | 2 +- .../extras/tests/Helpers/api/String.h | 2 +- .../tests/Helpers/progmem_emulation.hpp | 8 +- .../tests/IntegrationTests/CMakeLists.txt | 6 +- .../tests/IntegrationTests/gbathree.cpp | 2 +- .../tests/IntegrationTests/issue772.cpp | 2 +- .../tests/IntegrationTests/openweathermap.cpp | 2 +- .../tests/IntegrationTests/round_trip.cpp | 2 +- .../extras/tests/JsonArray/CMakeLists.txt | 4 +- .../extras/tests/JsonArray/add.cpp | 2 +- .../extras/tests/JsonArray/clear.cpp | 2 +- .../extras/tests/JsonArray/compare.cpp | 2 +- .../extras/tests/JsonArray/copyArray.cpp | 2 +- .../extras/tests/JsonArray/createNested.cpp | 2 +- .../extras/tests/JsonArray/equals.cpp | 2 +- .../extras/tests/JsonArray/isNull.cpp | 2 +- .../extras/tests/JsonArray/iterator.cpp | 2 +- .../extras/tests/JsonArray/memoryUsage.cpp | 2 +- .../extras/tests/JsonArray/nesting.cpp | 2 +- .../extras/tests/JsonArray/remove.cpp | 2 +- .../extras/tests/JsonArray/size.cpp | 2 +- .../extras/tests/JsonArray/std_string.cpp | 2 +- .../extras/tests/JsonArray/subscript.cpp | 2 +- .../extras/tests/JsonArray/unbound.cpp | 2 +- .../tests/JsonDeserializer/CMakeLists.txt | 4 +- .../JsonDeserializer/DeserializationError.cpp | 4 +- .../extras/tests/JsonDeserializer/array.cpp | 2 +- .../tests/JsonDeserializer/array_static.cpp | 2 +- .../extras/tests/JsonDeserializer/filter.cpp | 2 +- .../JsonDeserializer/incomplete_input.cpp | 2 +- .../tests/JsonDeserializer/input_types.cpp | 2 +- .../tests/JsonDeserializer/invalid_input.cpp | 2 +- .../extras/tests/JsonDeserializer/misc.cpp | 2 +- .../tests/JsonDeserializer/nestingLimit.cpp | 4 +- .../extras/tests/JsonDeserializer/number.cpp | 6 +- .../extras/tests/JsonDeserializer/object.cpp | 2 +- .../tests/JsonDeserializer/object_static.cpp | 2 +- .../extras/tests/JsonDeserializer/string.cpp | 2 +- .../tests/JsonDocument/BasicJsonDocument.cpp | 11 +- .../extras/tests/JsonDocument/CMakeLists.txt | 5 +- .../JsonDocument/DynamicJsonDocument.cpp | 4 +- .../tests/JsonDocument/ElementProxy.cpp | 4 +- .../extras/tests/JsonDocument/MemberProxy.cpp | 4 +- .../tests/JsonDocument/StaticJsonDocument.cpp | 2 +- .../extras/tests/JsonDocument/add.cpp | 2 +- .../extras/tests/JsonDocument/cast.cpp | 2 +- .../extras/tests/JsonDocument/compare.cpp | 2 +- .../extras/tests/JsonDocument/containsKey.cpp | 2 +- .../tests/JsonDocument/createNested.cpp | 2 +- .../extras/tests/JsonDocument/isNull.cpp | 2 +- .../{Cpp11 => JsonDocument}/issue1120.cpp | 0 .../extras/tests/JsonDocument/nesting.cpp | 2 +- .../extras/tests/JsonDocument/overflowed.cpp | 2 +- .../extras/tests/JsonDocument/remove.cpp | 2 +- .../extras/tests/JsonDocument/shrinkToFit.cpp | 4 +- .../extras/tests/JsonDocument/size.cpp | 2 +- .../extras/tests/JsonDocument/subscript.cpp | 2 +- .../extras/tests/JsonObject/CMakeLists.txt | 4 +- .../extras/tests/JsonObject/clear.cpp | 2 +- .../extras/tests/JsonObject/compare.cpp | 2 +- .../extras/tests/JsonObject/containsKey.cpp | 2 +- .../extras/tests/JsonObject/copy.cpp | 2 +- .../tests/JsonObject/createNestedArray.cpp | 2 +- .../tests/JsonObject/createNestedObject.cpp | 2 +- .../extras/tests/JsonObject/equals.cpp | 2 +- .../extras/tests/JsonObject/invalid.cpp | 2 +- .../extras/tests/JsonObject/isNull.cpp | 2 +- .../extras/tests/JsonObject/iterator.cpp | 2 +- .../extras/tests/JsonObject/memoryUsage.cpp | 2 +- .../extras/tests/JsonObject/nesting.cpp | 2 +- .../extras/tests/JsonObject/remove.cpp | 2 +- .../extras/tests/JsonObject/size.cpp | 2 +- .../extras/tests/JsonObject/std_string.cpp | 2 +- .../extras/tests/JsonObject/subscript.cpp | 2 +- .../tests/JsonSerializer/CMakeLists.txt | 4 +- .../tests/JsonSerializer/CustomWriter.cpp | 7 +- .../extras/tests/JsonSerializer/JsonArray.cpp | 2 +- .../tests/JsonSerializer/JsonArrayPretty.cpp | 2 +- .../tests/JsonSerializer/JsonObject.cpp | 2 +- .../tests/JsonSerializer/JsonObjectPretty.cpp | 2 +- .../tests/JsonSerializer/JsonVariant.cpp | 2 +- .../tests/JsonSerializer/std_stream.cpp | 2 +- .../tests/JsonSerializer/std_string.cpp | 2 +- .../extras/tests/JsonVariant/CMakeLists.txt | 6 +- .../extras/tests/JsonVariant/add.cpp | 2 +- .../extras/tests/JsonVariant/as.cpp | 4 +- .../extras/tests/JsonVariant/clear.cpp | 2 +- .../extras/tests/JsonVariant/compare.cpp | 2 +- .../extras/tests/JsonVariant/containsKey.cpp | 4 +- .../extras/tests/JsonVariant/converters.cpp | 8 +- .../extras/tests/JsonVariant/copy.cpp | 2 +- .../extras/tests/JsonVariant/createNested.cpp | 2 +- .../extras/tests/JsonVariant/is.cpp | 2 +- .../extras/tests/JsonVariant/isnull.cpp | 2 +- .../extras/tests/JsonVariant/memoryUsage.cpp | 2 +- .../extras/tests/JsonVariant/misc.cpp | 2 +- .../extras/tests/JsonVariant/nesting.cpp | 2 +- .../tests/{Cpp11 => JsonVariant}/nullptr.cpp | 12 +- .../extras/tests/JsonVariant/or.cpp | 2 +- .../extras/tests/JsonVariant/overflow.cpp | 2 +- .../extras/tests/JsonVariant/remove.cpp | 4 +- .../extras/tests/JsonVariant/set.cpp | 2 +- .../extras/tests/JsonVariant/shallowCopy.cpp | 2 +- .../extras/tests/JsonVariant/size.cpp | 2 +- .../{Cpp11 => JsonVariant}/stl_containers.cpp | 18 +- .../extras/tests/JsonVariant/subscript.cpp | 2 +- .../extras/tests/JsonVariant/types.cpp | 2 +- .../extras/tests/JsonVariant/unbound.cpp | 2 +- .../extras/tests/MemoryPool/CMakeLists.txt | 6 +- .../extras/tests/MemoryPool/StringCopier.cpp | 4 +- .../extras/tests/MemoryPool/allocVariant.cpp | 4 +- .../extras/tests/MemoryPool/clear.cpp | 4 +- .../extras/tests/MemoryPool/saveString.cpp | 4 +- .../extras/tests/MemoryPool/size.cpp | 4 +- .../extras/tests/Misc/CMakeLists.txt | 4 +- .../extras/tests/Misc/FloatParts.cpp | 4 +- .../extras/tests/Misc/JsonString.cpp | 2 +- .../extras/tests/Misc/NoArduinoHeader.cpp | 2 +- .../ArduinoJson/extras/tests/Misc/Readers.cpp | 6 +- .../extras/tests/Misc/StringAdapters.cpp | 11 +- .../extras/tests/Misc/StringWriter.cpp | 6 +- .../extras/tests/Misc/TypeTraits.cpp | 65 +- .../ArduinoJson/extras/tests/Misc/Utf16.cpp | 4 +- .../ArduinoJson/extras/tests/Misc/Utf8.cpp | 4 +- .../extras/tests/Misc/arithmeticCompare.cpp | 104 +- .../extras/tests/Misc/conflicts.cpp | 2 +- .../extras/tests/Misc/custom_string.hpp | 2 +- .../extras/tests/Misc/printable.cpp | 2 +- .../extras/tests/Misc/unsigned_char.cpp | 2 +- .../ArduinoJson/extras/tests/Misc/version.cpp | 2 +- .../extras/tests/Misc/weird_strcmp.hpp | 8 +- .../tests/MixedConfiguration/CMakeLists.txt | 6 +- .../MixedConfiguration/enable_alignment_0.cpp | 4 +- .../MixedConfiguration/enable_alignment_1.cpp | 2 +- .../MixedConfiguration/enable_comments_0.cpp | 2 +- .../MixedConfiguration/enable_comments_1.cpp | 2 +- .../MixedConfiguration/enable_infinity_1.cpp | 2 +- .../tests/MixedConfiguration/enable_nan_1.cpp | 2 +- .../MixedConfiguration/enable_progmem_1.cpp | 8 +- .../enable_string_deduplication_0.cpp | 2 +- .../enable_string_deduplication_1.cpp | 2 +- .../tests/MixedConfiguration/issue1707.cpp | 2 +- .../use_long_long_0.cpp | 0 .../use_long_long_1.cpp | 0 .../tests/MsgPackDeserializer/CMakeLists.txt | 4 +- .../MsgPackDeserializer/deserializeArray.cpp | 2 +- .../MsgPackDeserializer/deserializeObject.cpp | 2 +- .../deserializeStaticVariant.cpp | 2 +- .../deserializeVariant.cpp | 2 +- .../MsgPackDeserializer/doubleToFloat.cpp | 4 +- .../tests/MsgPackDeserializer/filter.cpp | 6 +- .../MsgPackDeserializer/incompleteInput.cpp | 2 +- .../tests/MsgPackDeserializer/input_types.cpp | 2 +- .../extras/tests/MsgPackDeserializer/misc.cpp | 4 +- .../MsgPackDeserializer/nestingLimit.cpp | 4 +- .../MsgPackDeserializer/notSupported.cpp | 2 +- .../tests/MsgPackSerializer/CMakeLists.txt | 4 +- .../MsgPackSerializer/destination_types.cpp | 2 +- .../tests/MsgPackSerializer/measure.cpp | 2 +- .../MsgPackSerializer/serializeArray.cpp | 2 +- .../MsgPackSerializer/serializeObject.cpp | 2 +- .../MsgPackSerializer/serializeVariant.cpp | 2 +- .../extras/tests/Numbers/CMakeLists.txt | 8 +- .../extras/tests/Numbers/convertNumber.cpp | 143 +- .../extras/tests/Numbers/parseDouble.cpp | 4 +- .../extras/tests/Numbers/parseFloat.cpp | 4 +- .../extras/tests/Numbers/parseInteger.cpp | 4 +- .../extras/tests/Numbers/parseNumber.cpp | 5 +- .../extras/tests/TextFormatter/CMakeLists.txt | 6 +- .../extras/tests/TextFormatter/writeFloat.cpp | 6 +- .../tests/TextFormatter/writeInteger.cpp | 4 +- .../tests/TextFormatter/writeString.cpp | 4 +- .../extras/tests/catch/CMakeLists.txt | 10 +- .../ArduinoJson/extras/tests/catch/catch.hpp | 24456 ++++++++++------ third-party/ArduinoJson/idf_component.yml | 2 +- third-party/ArduinoJson/library.json | 2 +- third-party/ArduinoJson/library.properties | 2 +- third-party/ArduinoJson/src/ArduinoJson.h | 2 +- third-party/ArduinoJson/src/ArduinoJson.hpp | 39 +- .../src/ArduinoJson/Array/ElementProxy.hpp | 10 +- .../src/ArduinoJson/Array/JsonArray.hpp | 39 +- .../src/ArduinoJson/Array/JsonArrayConst.hpp | 23 +- .../src/ArduinoJson/Array/JsonArrayImpl.hpp | 10 +- .../ArduinoJson/Array/JsonArrayIterator.hpp | 24 +- .../src/ArduinoJson/Array/Utilities.hpp | 29 +- .../ArduinoJson/Collection/CollectionData.hpp | 7 +- .../ArduinoJson/Collection/CollectionImpl.hpp | 6 +- .../src/ArduinoJson/Configuration.hpp | 29 +- .../Deserialization/DeserializationError.hpp | 21 +- .../DeserializationOptions.hpp | 35 + .../ArduinoJson/Deserialization/Filter.hpp | 10 +- .../Deserialization/NestingLimit.hpp | 9 +- .../ArduinoJson/Deserialization/Reader.hpp | 23 +- .../Readers/ArduinoStreamReader.hpp | 6 +- .../Readers/ArduinoStringReader.hpp | 8 +- .../Deserialization/Readers/FlashReader.hpp | 7 +- .../Readers/IteratorReader.hpp | 7 +- .../Deserialization/Readers/RamReader.hpp | 6 +- .../Readers/StdStreamReader.hpp | 7 +- .../Deserialization/Readers/VariantReader.hpp | 6 +- .../Deserialization/deserialize.hpp | 68 +- .../Document/BasicJsonDocument.hpp | 37 +- .../Document/DynamicJsonDocument.hpp | 6 +- .../src/ArduinoJson/Document/JsonDocument.hpp | 91 +- .../Document/StaticJsonDocument.hpp | 11 +- .../src/ArduinoJson/Json/EscapeSequence.hpp | 7 +- .../src/ArduinoJson/Json/JsonDeserializer.hpp | 144 +- .../src/ArduinoJson/Json/JsonSerializer.hpp | 17 +- .../src/ArduinoJson/Json/Latch.hpp | 6 +- .../ArduinoJson/Json/PrettyJsonSerializer.hpp | 13 +- .../src/ArduinoJson/Json/TextFormatter.hpp | 12 +- .../src/ArduinoJson/Json/Utf16.hpp | 6 +- .../ArduinoJson/src/ArduinoJson/Json/Utf8.hpp | 6 +- .../src/ArduinoJson/Memory/Alignment.hpp | 6 +- .../src/ArduinoJson/Memory/MemoryPool.hpp | 10 +- .../src/ArduinoJson/Misc/SafeBoolIdiom.hpp | 26 - .../src/ArduinoJson/Misc/SerializedValue.hpp | 9 +- .../MsgPack/MsgPackDeserializer.hpp | 169 +- .../ArduinoJson/MsgPack/MsgPackSerializer.hpp | 13 +- .../src/ArduinoJson/MsgPack/endianess.hpp | 6 +- .../src/ArduinoJson/MsgPack/ieee754.hpp | 6 +- .../ArduinoJson/src/ArduinoJson/Namespace.hpp | 33 +- .../src/ArduinoJson/Numbers/FloatParts.hpp | 15 +- .../src/ArduinoJson/Numbers/FloatTraits.hpp | 187 +- .../src/ArduinoJson/Numbers/JsonFloat.hpp | 7 +- .../src/ArduinoJson/Numbers/JsonInteger.hpp | 20 +- .../ArduinoJson/Numbers/arithmeticCompare.hpp | 11 +- .../src/ArduinoJson/Numbers/convertNumber.hpp | 14 +- .../src/ArduinoJson/Numbers/parseNumber.hpp | 8 +- .../src/ArduinoJson/Object/JsonObject.hpp | 77 +- .../ArduinoJson/Object/JsonObjectConst.hpp | 44 +- .../src/ArduinoJson/Object/JsonObjectImpl.hpp | 14 +- .../ArduinoJson/Object/JsonObjectIterator.hpp | 24 +- .../src/ArduinoJson/Object/JsonPair.hpp | 11 +- .../src/ArduinoJson/Object/MemberProxy.hpp | 10 +- .../src/ArduinoJson/Polyfills/alias_cast.hpp | 7 +- .../src/ArduinoJson/Polyfills/assert.hpp | 2 +- .../src/ArduinoJson/Polyfills/attributes.hpp | 8 +- .../src/ArduinoJson/Polyfills/ctype.hpp | 7 +- .../src/ArduinoJson/Polyfills/integer.hpp | 7 +- .../src/ArduinoJson/Polyfills/limits.hpp | 6 +- .../src/ArduinoJson/Polyfills/math.hpp | 6 +- .../src/ArduinoJson/Polyfills/mpl/max.hpp | 7 +- .../src/ArduinoJson/Polyfills/pgmspace.hpp | 44 +- .../Polyfills/pgmspace_generic.hpp | 36 +- .../ArduinoJson/Polyfills/preprocessor.hpp | 46 +- .../src/ArduinoJson/Polyfills/type_traits.hpp | 2 +- .../Polyfills/type_traits/conditional.hpp | 7 +- .../Polyfills/type_traits/declval.hpp | 8 +- .../Polyfills/type_traits/enable_if.hpp | 7 +- .../type_traits/integral_constant.hpp | 6 +- .../Polyfills/type_traits/is_array.hpp | 7 +- .../Polyfills/type_traits/is_base_of.hpp | 12 +- .../Polyfills/type_traits/is_class.hpp | 6 +- .../Polyfills/type_traits/is_const.hpp | 7 +- .../Polyfills/type_traits/is_convertible.hpp | 6 +- .../Polyfills/type_traits/is_enum.hpp | 6 +- .../type_traits/is_floating_point.hpp | 6 +- .../Polyfills/type_traits/is_integral.hpp | 13 +- .../Polyfills/type_traits/is_pointer.hpp | 7 +- .../Polyfills/type_traits/is_same.hpp | 7 +- .../Polyfills/type_traits/is_signed.hpp | 14 +- .../Polyfills/type_traits/is_unsigned.hpp | 12 +- .../Polyfills/type_traits/make_unsigned.hpp | 14 +- .../Polyfills/type_traits/make_void.hpp | 6 +- .../Polyfills/type_traits/remove_const.hpp | 7 +- .../Polyfills/type_traits/remove_cv.hpp | 7 +- .../type_traits/remove_reference.hpp | 7 +- .../Polyfills/type_traits/type_identity.hpp | 7 +- .../src/ArduinoJson/Polyfills/utility.hpp | 16 + .../Serialization/CountingDecorator.hpp | 6 +- .../src/ArduinoJson/Serialization/Writer.hpp | 6 +- .../Writers/ArduinoStringWriter.hpp | 8 +- .../Serialization/Writers/DummyWriter.hpp | 7 +- .../Serialization/Writers/PrintWriter.hpp | 8 +- .../Writers/StaticStringWriter.hpp | 7 +- .../Serialization/Writers/StdStreamWriter.hpp | 7 +- .../Serialization/Writers/StdStringWriter.hpp | 19 +- .../src/ArduinoJson/Serialization/measure.hpp | 8 +- .../ArduinoJson/Serialization/serialize.hpp | 19 +- .../StringStorage/StringCopier.hpp | 7 +- .../ArduinoJson/StringStorage/StringMover.hpp | 7 +- .../StringStorage/StringStorage.hpp | 6 +- .../Strings/Adapters/ArduinoString.hpp | 25 - .../Strings/Adapters/FlashString.hpp | 6 +- .../Strings/Adapters/JsonString.hpp | 6 +- .../Strings/Adapters/RamString.hpp | 6 +- .../Strings/Adapters/StdString.hpp | 23 - .../Strings/Adapters/StringObject.hpp | 51 + .../Strings/Adapters/StringView.hpp | 22 - .../src/ArduinoJson/Strings/IsString.hpp | 6 +- .../src/ArduinoJson/Strings/JsonString.hpp | 16 +- .../src/ArduinoJson/Strings/StoragePolicy.hpp | 6 +- .../src/ArduinoJson/Strings/StringAdapter.hpp | 6 +- .../ArduinoJson/Strings/StringAdapters.hpp | 19 +- .../src/ArduinoJson/Strings/StringTraits.hpp | 79 + .../src/ArduinoJson/Variant/Converter.hpp | 10 +- .../src/ArduinoJson/Variant/ConverterImpl.hpp | 119 +- .../src/ArduinoJson/Variant/JsonVariant.hpp | 37 +- .../ArduinoJson/Variant/JsonVariantConst.hpp | 65 +- .../src/ArduinoJson/Variant/SlotFunctions.hpp | 6 +- .../ArduinoJson/Variant/VariantAttorney.hpp | 6 +- .../ArduinoJson/Variant/VariantCompare.hpp | 14 +- .../ArduinoJson/Variant/VariantContent.hpp | 7 +- .../src/ArduinoJson/Variant/VariantData.hpp | 6 +- .../ArduinoJson/Variant/VariantFunctions.hpp | 6 +- .../src/ArduinoJson/Variant/VariantImpl.hpp | 6 +- .../ArduinoJson/Variant/VariantOperators.hpp | 11 +- .../ArduinoJson/Variant/VariantRefBase.hpp | 23 +- .../src/ArduinoJson/Variant/VariantSlot.hpp | 6 +- .../src/ArduinoJson/Variant/VariantTag.hpp | 6 +- .../src/ArduinoJson/Variant/VariantTo.hpp | 8 +- .../src/ArduinoJson/Variant/Visitor.hpp | 6 +- .../src/ArduinoJson/compatibility.hpp | 4 +- .../ArduinoJson/src/ArduinoJson/version.hpp | 8 +- third-party/ArduinoJson/src/CMakeLists.txt | 97 +- third-party/Synth_Dexed/.gitignore | 88 + third-party/Synth_Dexed/examples/Banks/name.c | 15 + .../examples/SimplePlay/SimplePlay.ino | 5 + .../Synth_Dexed/examples/SimplePlay/name.c | 15 + .../SimplePlayAndEngineChange.ino | 171 +- .../examples/SimplePlayAndEngineChange/name.c | 15 + third-party/Synth_Dexed/name.c | 11 + third-party/Synth_Dexed/src/EngineMkI.cpp | 704 +- third-party/Synth_Dexed/src/EngineMkI.h | 87 +- third-party/Synth_Dexed/src/EngineMsfa.cpp | 66 + third-party/Synth_Dexed/src/EngineMsfa.h | 27 + third-party/Synth_Dexed/src/EngineOpl.cpp | 442 +- third-party/Synth_Dexed/src/EngineOpl.h | 74 +- third-party/Synth_Dexed/src/controllers.h | 6 +- third-party/Synth_Dexed/src/dexed.cpp | 21 +- third-party/Synth_Dexed/src/dexed.h | 9 +- third-party/Synth_Dexed/src/fast_log.h | 50 - third-party/Synth_Dexed/src/fm_core.cpp | 44 - third-party/Synth_Dexed/src/fm_core.h | 4 +- third-party/Synth_Dexed/src/synth.h | 26 - third-party/Synth_Dexed/tools/sysex/test.syx | Bin 0 -> 4104 bytes 386 files changed, 18199 insertions(+), 11962 deletions(-) delete mode 100644 third-party/ArduinoJson/extras/tests/Cpp11/CMakeLists.txt rename third-party/ArduinoJson/extras/tests/{Cpp11 => JsonDocument}/issue1120.cpp (100%) rename third-party/ArduinoJson/extras/tests/{Cpp11 => JsonVariant}/nullptr.cpp (75%) rename third-party/ArduinoJson/extras/tests/{Cpp11 => JsonVariant}/stl_containers.cpp (87%) rename third-party/ArduinoJson/extras/tests/{Cpp11 => MixedConfiguration}/use_long_long_0.cpp (100%) rename third-party/ArduinoJson/extras/tests/{Cpp11 => MixedConfiguration}/use_long_long_1.cpp (100%) create mode 100644 third-party/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationOptions.hpp delete mode 100644 third-party/ArduinoJson/src/ArduinoJson/Misc/SafeBoolIdiom.hpp create mode 100644 third-party/ArduinoJson/src/ArduinoJson/Polyfills/utility.hpp delete mode 100644 third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/ArduinoString.hpp delete mode 100644 third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StdString.hpp create mode 100644 third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringObject.hpp delete mode 100644 third-party/ArduinoJson/src/ArduinoJson/Strings/Adapters/StringView.hpp create mode 100644 third-party/ArduinoJson/src/ArduinoJson/Strings/StringTraits.hpp create mode 100644 third-party/Synth_Dexed/.gitignore create mode 100644 third-party/Synth_Dexed/examples/Banks/name.c create mode 100644 third-party/Synth_Dexed/examples/SimplePlay/name.c create mode 100644 third-party/Synth_Dexed/examples/SimplePlayAndEngineChange/name.c create mode 100644 third-party/Synth_Dexed/name.c create mode 100644 third-party/Synth_Dexed/src/EngineMsfa.cpp create mode 100644 third-party/Synth_Dexed/src/EngineMsfa.h delete mode 100644 third-party/Synth_Dexed/src/fast_log.h create mode 100644 third-party/Synth_Dexed/tools/sysex/test.syx diff --git a/UI.hpp b/UI.hpp index 6c46a62..3033e56 100644 --- a/UI.hpp +++ b/UI.hpp @@ -4912,6 +4912,7 @@ void UI_func_engine(uint8_t param) { if (LCDML.FUNC_close()) // ****** STABLE END ********* { + lcd_special_chars(SCROLLBAR); encoderDir[ENC_R].reset(); } } diff --git a/third-party/ArduinoJson/ArduinoJson.h b/third-party/ArduinoJson/ArduinoJson.h index 7e3afa5..15c218f 100644 --- a/third-party/ArduinoJson/ArduinoJson.h +++ b/third-party/ArduinoJson/ArduinoJson.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include "src/ArduinoJson.h" diff --git a/third-party/ArduinoJson/CHANGELOG.md b/third-party/ArduinoJson/CHANGELOG.md index dd4945b..bee7434 100644 --- a/third-party/ArduinoJson/CHANGELOG.md +++ b/third-party/ArduinoJson/CHANGELOG.md @@ -1,6 +1,13 @@ ArduinoJson: change log ======================= +v6.21.0 (2023-03-14) +------- + +* Drop support for C++98/C++03. Minimum required is C++11. +* Remove `ARDUINOJSON_NAMESPACE`; use `ArduinoJson` instead. +* Make string support generic (issue #1807) + v6.20.1 (2023-02-08) ------- diff --git a/third-party/ArduinoJson/CMakeLists.txt b/third-party/ArduinoJson/CMakeLists.txt index f31fffe..575b5d0 100644 --- a/third-party/ArduinoJson/CMakeLists.txt +++ b/third-party/ArduinoJson/CMakeLists.txt @@ -1,19 +1,19 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License cmake_minimum_required(VERSION 3.15) if(ESP_PLATFORM) - # Build ArduinoJson as an ESP-IDF component - idf_component_register(INCLUDE_DIRS src) - return() + # Build ArduinoJson as an ESP-IDF component + idf_component_register(INCLUDE_DIRS src) + return() endif() -project(ArduinoJson VERSION 6.20.1) +project(ArduinoJson VERSION 6.21.0) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - include(CTest) + include(CTest) endif() add_subdirectory(src) diff --git a/third-party/ArduinoJson/LICENSE.txt b/third-party/ArduinoJson/LICENSE.txt index e59620d..15f1b9f 100644 --- a/third-party/ArduinoJson/LICENSE.txt +++ b/third-party/ArduinoJson/LICENSE.txt @@ -1,7 +1,7 @@ The MIT License (MIT) --------------------- -Copyright © 2014-2022, Benoit BLANCHON +Copyright © 2014-2023, Benoit BLANCHON Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/third-party/ArduinoJson/README.md b/third-party/ArduinoJson/README.md index b0f539d..fdb3f88 100644 --- a/third-party/ArduinoJson/README.md +++ b/third-party/ArduinoJson/README.md @@ -8,9 +8,9 @@ [![Continuous Integration](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/6.x?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) [![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/6.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) -[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.20.1&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.20.1) -[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.20.1)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.20.1) -[![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.20.1&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson) +[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.21.0&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.21.0) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.21.0)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.21.0) +[![ESP IDF](https://img.shields.io/static/v1?label=ESP+IDF&message=v6.21.0&logo=cpu&logoColor=white&color=blue)](https://components.espressif.com/components/bblanchon/arduinojson) [![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github&color=orange)](https://github.com/bblanchon/ArduinoJson/stargazers) [![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github&color=orange)](https://github.com/sponsors/bblanchon) @@ -46,7 +46,8 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). * Supports [custom converters](https://arduinojson.org/news/2021/05/04/version-6-18-0/) * Portable * Usable on any C++ project (not limited to Arduino) - * Compatible with C++98, C++11, C++14 and C++17 + * Compatible with C++11, C++14 and C++17 + * Support for C++98/C++03 available on [ArduinoJson 6.20.x](https://github.com/bblanchon/ArduinoJson/tree/6.20.x) * Zero warnings with `-Wall -Wextra -pedantic` and `/W4` * [Header-only library](https://en.wikipedia.org/wiki/Header-only) * Works with virtually any board @@ -83,9 +84,9 @@ ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things). * Well tested * [Unit test coverage close to 100%](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x) * Continuously tested on - * [Visual Studio 2010, 2012, 2013, 2015, 2017, 2019, 2022](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) - * [GCC 4.4, 4.6, 4.7, 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) - * [Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) + * [Visual Studio 2017, 2019, 2022](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x) + * [GCC 6, 7, 8, 9, 10, 11](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) + * [Clang 3.8, 3.9, 4.0, 5.0, 6.0, 7, 8, 9, 10](https://github.com/bblanchon/ArduinoJson/actions?query=workflow%3A%22Continuous+Integration%22) * [Continuously fuzzed with Google OSS Fuzz](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson) * Passes all default checks of [clang-tidy](https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/) * Well documented diff --git a/third-party/ArduinoJson/appveyor.yml b/third-party/ArduinoJson/appveyor.yml index 06681d4..591b242 100644 --- a/third-party/ArduinoJson/appveyor.yml +++ b/third-party/ArduinoJson/appveyor.yml @@ -1,4 +1,4 @@ -version: 6.20.1.{build} +version: 6.21.0.{build} environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 @@ -7,15 +7,6 @@ environment: CMAKE_GENERATOR: Visual Studio 16 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 CMAKE_GENERATOR: Visual Studio 15 2017 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - CMAKE_GENERATOR: Visual Studio 14 2015 - - CMAKE_GENERATOR: Visual Studio 12 2013 - - CMAKE_GENERATOR: Visual Studio 11 2012 - - CMAKE_GENERATOR: Visual Studio 10 2010 - - CMAKE_GENERATOR: Ninja - MINGW: MinGW # MinGW 32-bit 5.3.0 - - CMAKE_GENERATOR: Ninja - MINGW32: i686-5.3.0-posix-dwarf-rt_v4-rev0 # MinGW-w64 5.3.0 - CMAKE_GENERATOR: Ninja MINGW32: i686-6.3.0-posix-dwarf-rt_v5-rev1 # MinGW-w64 6.3.0 i686 - CMAKE_GENERATOR: Ninja diff --git a/third-party/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino b/third-party/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino index 3443ba7..b2819d5 100644 --- a/third-party/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino +++ b/third-party/ArduinoJson/examples/JsonConfigFile/JsonConfigFile.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to store your project configuration in a file. diff --git a/third-party/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino b/third-party/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino index b546cd1..fc980aa 100644 --- a/third-party/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino +++ b/third-party/ArduinoJson/examples/JsonFilterExample/JsonFilterExample.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to use DeserializationOption::Filter diff --git a/third-party/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino b/third-party/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino index ae1c0e2..cf4ab0d 100644 --- a/third-party/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino +++ b/third-party/ArduinoJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to generate a JSON document with ArduinoJson. diff --git a/third-party/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino b/third-party/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino index 8e2e6d7..72f311f 100644 --- a/third-party/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino +++ b/third-party/ArduinoJson/examples/JsonHttpClient/JsonHttpClient.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to parse a JSON document in an HTTP response. diff --git a/third-party/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino b/third-party/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino index 10f1419..a9d8b6d 100644 --- a/third-party/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino +++ b/third-party/ArduinoJson/examples/JsonParserExample/JsonParserExample.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to deserialize a JSON document with ArduinoJson. diff --git a/third-party/ArduinoJson/examples/JsonServer/JsonServer.ino b/third-party/ArduinoJson/examples/JsonServer/JsonServer.ino index 52d55c5..a897fce 100644 --- a/third-party/ArduinoJson/examples/JsonServer/JsonServer.ino +++ b/third-party/ArduinoJson/examples/JsonServer/JsonServer.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to implement an HTTP server that sends a JSON document diff --git a/third-party/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino b/third-party/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino index 87965a3..6c369fa 100644 --- a/third-party/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino +++ b/third-party/ArduinoJson/examples/JsonUdpBeacon/JsonUdpBeacon.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to send a JSON document to a UDP socket. diff --git a/third-party/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino b/third-party/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino index a14245b..1a54c3b 100644 --- a/third-party/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino +++ b/third-party/ArduinoJson/examples/MsgPackParser/MsgPackParser.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to deserialize a MessagePack document with diff --git a/third-party/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino b/third-party/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino index 1a13ea0..68b8ec5 100644 --- a/third-party/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino +++ b/third-party/ArduinoJson/examples/ProgmemExample/ProgmemExample.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows the different ways you can use Flash strings with diff --git a/third-party/ArduinoJson/examples/StringExample/StringExample.ino b/third-party/ArduinoJson/examples/StringExample/StringExample.ino index 3d8f9e4..3e51b91 100644 --- a/third-party/ArduinoJson/examples/StringExample/StringExample.ino +++ b/third-party/ArduinoJson/examples/StringExample/StringExample.ino @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows the different ways you can use String with ArduinoJson. diff --git a/third-party/ArduinoJson/extras/CompileOptions.cmake b/third-party/ArduinoJson/extras/CompileOptions.cmake index 82a750a..0cbd576 100644 --- a/third-party/ArduinoJson/extras/CompileOptions.cmake +++ b/third-party/ArduinoJson/extras/CompileOptions.cmake @@ -27,11 +27,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") if(${COVERAGE}) set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage") endif() - endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) AND (NOT ${COVERAGE})) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) AND(NOT ${COVERAGE})) add_compile_options(-g -Og) else() add_compile_options(-g -O0) @@ -65,7 +64,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) AND (NOT ${COVERAGE})) + if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.0) AND(NOT ${COVERAGE})) add_compile_options(-g -Og) else() add_compile_options(-g -O0) @@ -73,7 +72,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) AND (NOT ${COVERAGE})) + if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0) AND(NOT ${COVERAGE})) add_compile_options(-g -Og) else() add_compile_options(-g -O0) @@ -85,17 +84,12 @@ if(MSVC) add_compile_options( /W4 # Set warning level /WX # Treats all compiler warnings as errors. + /Zc:__cplusplus # Enable updated __cplusplus macro ) - - if (NOT MSVC_VERSION LESS 1910) # >= Visual Studio 2017 - add_compile_options( - /Zc:__cplusplus # Enable updated __cplusplus macro - ) - endif() endif() if(MINGW) - # Static link on MinGW to avoid linking with the wrong DLLs when multiple + # Static link on MinGW to avoid linking with the wrong DLLs when multiple # versions are installed. add_link_options(-static) endif() diff --git a/third-party/ArduinoJson/extras/ci/espidf/CMakeLists.txt b/third-party/ArduinoJson/extras/ci/espidf/CMakeLists.txt index e3c4475..3b87896 100644 --- a/third-party/ArduinoJson/extras/ci/espidf/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/ci/espidf/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License cmake_minimum_required(VERSION 3.5) diff --git a/third-party/ArduinoJson/extras/ci/espidf/main/CMakeLists.txt b/third-party/ArduinoJson/extras/ci/espidf/main/CMakeLists.txt index f06bfda..3e10ef8 100644 --- a/third-party/ArduinoJson/extras/ci/espidf/main/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/ci/espidf/main/CMakeLists.txt @@ -1,6 +1,8 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License -idf_component_register(SRCS "main.cpp" - INCLUDE_DIRS "") +idf_component_register( + SRCS "main.cpp" + INCLUDE_DIRS "" +) diff --git a/third-party/ArduinoJson/extras/ci/espidf/main/main.cpp b/third-party/ArduinoJson/extras/ci/espidf/main/main.cpp index 50d7ec0..4818a67 100644 --- a/third-party/ArduinoJson/extras/ci/espidf/main/main.cpp +++ b/third-party/ArduinoJson/extras/ci/espidf/main/main.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/conf_test/avr.cpp b/third-party/ArduinoJson/extras/conf_test/avr.cpp index cd0b4bd..fda9446 100644 --- a/third-party/ArduinoJson/extras/conf_test/avr.cpp +++ b/third-party/ArduinoJson/extras/conf_test/avr.cpp @@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); -static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 8, +static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 8, "sizeof(VariantSlot)"); void setup() {} diff --git a/third-party/ArduinoJson/extras/conf_test/esp8266.cpp b/third-party/ArduinoJson/extras/conf_test/esp8266.cpp index bb9988b..caf70b2 100644 --- a/third-party/ArduinoJson/extras/conf_test/esp8266.cpp +++ b/third-party/ArduinoJson/extras/conf_test/esp8266.cpp @@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); -static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 16, +static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 16, "sizeof(VariantSlot)"); void setup() {} diff --git a/third-party/ArduinoJson/extras/conf_test/x64.cpp b/third-party/ArduinoJson/extras/conf_test/x64.cpp index 8cd6c06..97838e3 100644 --- a/third-party/ArduinoJson/extras/conf_test/x64.cpp +++ b/third-party/ArduinoJson/extras/conf_test/x64.cpp @@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); -static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 32, +static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 32, "sizeof(VariantSlot)"); int main() {} diff --git a/third-party/ArduinoJson/extras/conf_test/x86.cpp b/third-party/ArduinoJson/extras/conf_test/x86.cpp index dab9da6..f3dab30 100644 --- a/third-party/ArduinoJson/extras/conf_test/x86.cpp +++ b/third-party/ArduinoJson/extras/conf_test/x86.cpp @@ -9,7 +9,7 @@ static_assert(ARDUINOJSON_LITTLE_ENDIAN == 1, "ARDUINOJSON_LITTLE_ENDIAN"); static_assert(ARDUINOJSON_USE_DOUBLE == 1, "ARDUINOJSON_USE_DOUBLE"); -static_assert(sizeof(ARDUINOJSON_NAMESPACE::VariantSlot) == 16, +static_assert(sizeof(ArduinoJson::detail::VariantSlot) == 16, "sizeof(VariantSlot)"); int main() {} diff --git a/third-party/ArduinoJson/extras/fuzzing/CMakeLists.txt b/third-party/ArduinoJson/extras/fuzzing/CMakeLists.txt index e5d6a36..1d439f4 100644 --- a/third-party/ArduinoJson/extras/fuzzing/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/fuzzing/CMakeLists.txt @@ -1,7 +1,10 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + if(MSVC) add_compile_options(-D_CRT_SECURE_NO_WARNINGS) endif() @@ -22,7 +25,7 @@ target_link_libraries(json_reproducer ArduinoJson ) -macro(add_fuzzer name) +macro(add_fuzzer name) set(FUZZER "${name}_fuzzer") set(CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_corpus") set(SEED_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}_seed_corpus") @@ -33,27 +36,23 @@ macro(add_fuzzer name) ArduinoJson ) set_target_properties("${FUZZER}" - PROPERTIES - COMPILE_FLAGS - "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" - LINK_FLAGS - "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" + PROPERTIES + COMPILE_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" + LINK_FLAGS "-fprofile-instr-generate -fcoverage-mapping -fsanitize=fuzzer -fno-sanitize-recover=all" ) add_test( - NAME - "${FUZZER}" - COMMAND - "${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1 + NAME "${FUZZER}" + COMMAND "${FUZZER}" "${CORPUS_DIR}" "${SEED_CORPUS_DIR}" -max_total_time=5 -timeout=1 ) set_tests_properties("${FUZZER}" PROPERTIES - LABELS "Fuzzing" + LABELS "Fuzzing" ) endmacro() -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6) add_fuzzer(json) add_fuzzer(msgpack) endif() diff --git a/third-party/ArduinoJson/extras/fuzzing/Makefile b/third-party/ArduinoJson/extras/fuzzing/Makefile index d3c574e..81fc412 100644 --- a/third-party/ArduinoJson/extras/fuzzing/Makefile +++ b/third-party/ArduinoJson/extras/fuzzing/Makefile @@ -1,6 +1,6 @@ # CAUTION: this file is invoked by https://github.com/google/oss-fuzz -CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 +CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 -std=c++11 all: \ $(OUT)/json_fuzzer \ diff --git a/third-party/ArduinoJson/extras/fuzzing/reproducer.cpp b/third-party/ArduinoJson/extras/fuzzing/reproducer.cpp index 8681801..a004d01 100644 --- a/third-party/ArduinoJson/extras/fuzzing/reproducer.cpp +++ b/third-party/ArduinoJson/extras/fuzzing/reproducer.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // This file is NOT use by Google's OSS fuzz diff --git a/third-party/ArduinoJson/extras/scripts/build-single-header.sh b/third-party/ArduinoJson/extras/scripts/build-single-header.sh index 09d91d4..00292e3 100755 --- a/third-party/ArduinoJson/extras/scripts/build-single-header.sh +++ b/third-party/ArduinoJson/extras/scripts/build-single-header.sh @@ -53,7 +53,8 @@ process() } simplify_namespaces() { - perl -p0i -e 's|\} // namespace ARDUINOJSON_NAMESPACE\r?\nnamespace ARDUINOJSON_NAMESPACE \{\r?\n||igs' "$1" + perl -p0i -e 's|ARDUINOJSON_END_PUBLIC_NAMESPACE\r?\nARDUINOJSON_BEGIN_PUBLIC_NAMESPACE\r?\n||igs' "$1" + perl -p0i -e 's|ARDUINOJSON_END_PRIVATE_NAMESPACE\r?\nARDUINOJSON_BEGIN_PRIVATE_NAMESPACE\r?\n||igs' "$1" rm -f "$1.bak" } diff --git a/third-party/ArduinoJson/extras/scripts/publish.sh b/third-party/ArduinoJson/extras/scripts/publish.sh index d3459d0..a562a24 100755 --- a/third-party/ArduinoJson/extras/scripts/publish.sh +++ b/third-party/ArduinoJson/extras/scripts/publish.sh @@ -51,7 +51,7 @@ update_version_in_source () { } commit_new_version () { - git add src/ArduinoJson/version.hpp README.md CHANGELOG.md library.json library.properties appveyor.yml CMakeLists.txt + git add src/ArduinoJson/version.hpp README.md CHANGELOG.md library.json library.properties appveyor.yml CMakeLists.txt idf_component.yml git commit -m "Set version to $VERSION" } diff --git a/third-party/ArduinoJson/extras/scripts/wandbox/JsonGeneratorExample.cpp b/third-party/ArduinoJson/extras/scripts/wandbox/JsonGeneratorExample.cpp index 0090c84..b35d185 100644 --- a/third-party/ArduinoJson/extras/scripts/wandbox/JsonGeneratorExample.cpp +++ b/third-party/ArduinoJson/extras/scripts/wandbox/JsonGeneratorExample.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to generate a JSON document with ArduinoJson. diff --git a/third-party/ArduinoJson/extras/scripts/wandbox/JsonParserExample.cpp b/third-party/ArduinoJson/extras/scripts/wandbox/JsonParserExample.cpp index f513caf..396f98c 100644 --- a/third-party/ArduinoJson/extras/scripts/wandbox/JsonParserExample.cpp +++ b/third-party/ArduinoJson/extras/scripts/wandbox/JsonParserExample.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to deserialize a JSON document with ArduinoJson. diff --git a/third-party/ArduinoJson/extras/scripts/wandbox/MsgPackParserExample.cpp b/third-party/ArduinoJson/extras/scripts/wandbox/MsgPackParserExample.cpp index 186816e..763de84 100644 --- a/third-party/ArduinoJson/extras/scripts/wandbox/MsgPackParserExample.cpp +++ b/third-party/ArduinoJson/extras/scripts/wandbox/MsgPackParserExample.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // // This example shows how to generate a JSON document with ArduinoJson. diff --git a/third-party/ArduinoJson/extras/tests/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/CMakeLists.txt index faf4cd9..c62401f 100644 --- a/third-party/ArduinoJson/extras/tests/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/CMakeLists.txt @@ -1,8 +1,8 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License -set(CMAKE_CXX_STANDARD 98) +set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_subdirectory(catch) @@ -10,7 +10,6 @@ add_subdirectory(catch) link_libraries(ArduinoJson catch) include_directories(Helpers) -add_subdirectory(Cpp11) add_subdirectory(Cpp17) add_subdirectory(Cpp20) add_subdirectory(FailingBuilds) diff --git a/third-party/ArduinoJson/extras/tests/Cpp11/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/Cpp11/CMakeLists.txt deleted file mode 100644 index 0b84a14..0000000 --- a/third-party/ArduinoJson/extras/tests/Cpp11/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON -# MIT License - -if("cxx_nullptr" IN_LIST CMAKE_CXX_COMPILE_FEATURES) - list(APPEND SOURCES nullptr.cpp) - add_definitions(-DARDUINOJSON_HAS_NULLPTR=1) -endif() - -if("cxx_auto_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES) - list(APPEND SOURCES issue1120.cpp) -endif() - -if("cxx_long_long_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES) - list(APPEND SOURCES use_long_long_0.cpp use_long_long_1.cpp) -endif() - -if("cxx_range_for" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_generalized_initializers" IN_LIST CMAKE_CXX_COMPILE_FEATURES) - list(APPEND SOURCES stl_containers.cpp) -endif() - -if(NOT SOURCES) - return() -endif() - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -add_executable(Cpp11Tests ${SOURCES}) - -add_test(Cpp11 Cpp11Tests) - -set_tests_properties(Cpp11 - PROPERTIES - LABELS "Catch" -) diff --git a/third-party/ArduinoJson/extras/tests/Cpp17/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/Cpp17/CMakeLists.txt index 05af200..62f2784 100644 --- a/third-party/ArduinoJson/extras/tests/Cpp17/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/Cpp17/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License if(MSVC_VERSION LESS 1910) @@ -25,5 +25,5 @@ add_test(Cpp17 Cpp17Tests) set_tests_properties(Cpp17 PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/Cpp17/string_view.cpp b/third-party/ArduinoJson/extras/tests/Cpp17/string_view.cpp index 729c59a..6a51ce2 100644 --- a/third-party/ArduinoJson/extras/tests/Cpp17/string_view.cpp +++ b/third-party/ArduinoJson/extras/tests/Cpp17/string_view.cpp @@ -1,6 +1,6 @@ #include - #include + #include #if !ARDUINOJSON_ENABLE_STRING_VIEW @@ -86,7 +86,7 @@ TEST_CASE("string_view") { } } -using ARDUINOJSON_NAMESPACE::adaptString; +using ArduinoJson::detail::adaptString; TEST_CASE("StringViewAdapter") { std::string_view str("bravoXXX", 5); diff --git a/third-party/ArduinoJson/extras/tests/Cpp20/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/Cpp20/CMakeLists.txt index 2c9a72b..e993e97 100644 --- a/third-party/ArduinoJson/extras/tests/Cpp20/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/Cpp20/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License if(MSVC_VERSION LESS 1910) @@ -25,5 +25,5 @@ add_test(Cpp20 Cpp20Tests) set_tests_properties(Cpp20 PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/FailingBuilds/CMakeLists.txt index dc76c91..0464908 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/CMakeLists.txt @@ -1,29 +1,25 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License macro(build_should_fail target) set_target_properties(${target} PROPERTIES - EXCLUDE_FROM_ALL TRUE - EXCLUDE_FROM_DEFAULT_BUILD TRUE + EXCLUDE_FROM_ALL TRUE + EXCLUDE_FROM_DEFAULT_BUILD TRUE ) add_test( - NAME - ${target} - COMMAND - ${CMAKE_COMMAND} --build . --target ${target} --config $ - WORKING_DIRECTORY - ${CMAKE_BINARY_DIR} + NAME ${target} + COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $ + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - set_tests_properties(${target} + set_tests_properties(${target} PROPERTIES - WILL_FAIL TRUE - LABELS "WillFail;Catch" + WILL_FAIL TRUE + LABELS "WillFail;Catch" ) endmacro() - add_executable(Issue978 Issue978.cpp) build_should_fail(Issue978) @@ -31,11 +27,9 @@ add_executable(Issue1189 Issue1189.cpp) build_should_fail(Issue1189) add_executable(read_long_long read_long_long.cpp) -set_property(TARGET read_long_long PROPERTY CXX_STANDARD 11) build_should_fail(read_long_long) add_executable(write_long_long write_long_long.cpp) -set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11) build_should_fail(write_long_long) add_executable(delete_jsondocument delete_jsondocument.cpp) diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue1189.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue1189.cpp index e86bb99..40cb59f 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue1189.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue1189.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue978.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue978.cpp index 112d36d..d85aaa0 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue978.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/Issue978.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/assign_char.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/assign_char.cpp index 633b54d..b9d897f 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/assign_char.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/assign_char.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/delete_jsondocument.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/delete_jsondocument.cpp index ef2b0e8..174b80a 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/delete_jsondocument.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/delete_jsondocument.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/read_long_long.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/read_long_long.cpp index d900a7f..6fe5992 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/read_long_long.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/read_long_long.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_USE_LONG_LONG 0 @@ -9,10 +9,6 @@ # error This test requires sizeof(long) < 8 #endif -#if !ARDUINOJSON_HAS_LONG_LONG -# error This test requires C++11 -#endif - ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(long long) int main() { DynamicJsonDocument doc(1024); diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp index 41885cf..1a9e834 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/FailingBuilds/write_long_long.cpp b/third-party/ArduinoJson/extras/tests/FailingBuilds/write_long_long.cpp index 2213a4d..6ff8356 100644 --- a/third-party/ArduinoJson/extras/tests/FailingBuilds/write_long_long.cpp +++ b/third-party/ArduinoJson/extras/tests/FailingBuilds/write_long_long.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_USE_LONG_LONG 0 @@ -9,10 +9,6 @@ # error This test requires sizeof(long) < 8 #endif -#if !ARDUINOJSON_HAS_LONG_LONG -# error This test requires C++11 -#endif - int main() { DynamicJsonDocument doc(1024); doc["dummy"] = static_cast(42); diff --git a/third-party/ArduinoJson/extras/tests/Helpers/Arduino.h b/third-party/ArduinoJson/extras/tests/Helpers/Arduino.h index bacc1a8..5f6f3fe 100644 --- a/third-party/ArduinoJson/extras/tests/Helpers/Arduino.h +++ b/third-party/ArduinoJson/extras/tests/Helpers/Arduino.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once diff --git a/third-party/ArduinoJson/extras/tests/Helpers/CustomReader.hpp b/third-party/ArduinoJson/extras/tests/Helpers/CustomReader.hpp index 8a97b50..da19d3f 100644 --- a/third-party/ArduinoJson/extras/tests/Helpers/CustomReader.hpp +++ b/third-party/ArduinoJson/extras/tests/Helpers/CustomReader.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once @@ -11,6 +11,7 @@ class CustomReader { public: CustomReader(const char* input) : _stream(input) {} + CustomReader(const CustomReader&) = delete; int read() { return _stream.get(); @@ -20,7 +21,4 @@ class CustomReader { _stream.read(buffer, static_cast(length)); return static_cast(_stream.gcount()); } - - private: - CustomReader(const CustomReader&); }; diff --git a/third-party/ArduinoJson/extras/tests/Helpers/api/Print.h b/third-party/ArduinoJson/extras/tests/Helpers/api/Print.h index 864fb41..d3c27cc 100644 --- a/third-party/ArduinoJson/extras/tests/Helpers/api/Print.h +++ b/third-party/ArduinoJson/extras/tests/Helpers/api/Print.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once diff --git a/third-party/ArduinoJson/extras/tests/Helpers/api/Stream.h b/third-party/ArduinoJson/extras/tests/Helpers/api/Stream.h index 8cc18d2..387940b 100644 --- a/third-party/ArduinoJson/extras/tests/Helpers/api/Stream.h +++ b/third-party/ArduinoJson/extras/tests/Helpers/api/Stream.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once diff --git a/third-party/ArduinoJson/extras/tests/Helpers/api/String.h b/third-party/ArduinoJson/extras/tests/Helpers/api/String.h index e55ea44..64c763f 100644 --- a/third-party/ArduinoJson/extras/tests/Helpers/api/String.h +++ b/third-party/ArduinoJson/extras/tests/Helpers/api/String.h @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once diff --git a/third-party/ArduinoJson/extras/tests/Helpers/progmem_emulation.hpp b/third-party/ArduinoJson/extras/tests/Helpers/progmem_emulation.hpp index 41597dc..ecb9f50 100644 --- a/third-party/ArduinoJson/extras/tests/Helpers/progmem_emulation.hpp +++ b/third-party/ArduinoJson/extras/tests/Helpers/progmem_emulation.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include // uint8_t @@ -23,7 +23,7 @@ inline uint8_t pgm_read_byte(const void* p) { return *reinterpret_cast(convertFlashToPtr(p)); } -#define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, value) \ - static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = value; \ - static type const* name = reinterpret_cast( \ +#define ARDUINOJSON_DEFINE_PROGMEM_ARRAY(type, name, ...) \ + static type const ARDUINOJSON_CONCAT2(name, _progmem)[] = __VA_ARGS__; \ + static type const* name = reinterpret_cast( \ convertPtrToFlash(ARDUINOJSON_CONCAT2(name, _progmem))); diff --git a/third-party/ArduinoJson/extras/tests/IntegrationTests/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/IntegrationTests/CMakeLists.txt index 88b5ba6..e8113e2 100644 --- a/third-party/ArduinoJson/extras/tests/IntegrationTests/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/IntegrationTests/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(IntegrationTests @@ -12,7 +12,7 @@ add_executable(IntegrationTests if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") target_compile_options(IntegrationTests PUBLIC - -fsingle-precision-constant # issue 544 + -fsingle-precision-constant # issue 544 ) endif() @@ -20,5 +20,5 @@ add_test(IntegrationTests IntegrationTests) set_tests_properties(IntegrationTests PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/IntegrationTests/gbathree.cpp b/third-party/ArduinoJson/extras/tests/IntegrationTests/gbathree.cpp index 2190eb1..34c4d0d 100644 --- a/third-party/ArduinoJson/extras/tests/IntegrationTests/gbathree.cpp +++ b/third-party/ArduinoJson/extras/tests/IntegrationTests/gbathree.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/IntegrationTests/issue772.cpp b/third-party/ArduinoJson/extras/tests/IntegrationTests/issue772.cpp index 4984b43..dd85a08 100644 --- a/third-party/ArduinoJson/extras/tests/IntegrationTests/issue772.cpp +++ b/third-party/ArduinoJson/extras/tests/IntegrationTests/issue772.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/IntegrationTests/openweathermap.cpp b/third-party/ArduinoJson/extras/tests/IntegrationTests/openweathermap.cpp index 44e2f76..e91ac0a 100644 --- a/third-party/ArduinoJson/extras/tests/IntegrationTests/openweathermap.cpp +++ b/third-party/ArduinoJson/extras/tests/IntegrationTests/openweathermap.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/IntegrationTests/round_trip.cpp b/third-party/ArduinoJson/extras/tests/IntegrationTests/round_trip.cpp index edc5538..ede311d 100644 --- a/third-party/ArduinoJson/extras/tests/IntegrationTests/round_trip.cpp +++ b/third-party/ArduinoJson/extras/tests/IntegrationTests/round_trip.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/JsonArray/CMakeLists.txt index 9f89799..d97a2b1 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/JsonArray/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(JsonArrayTests @@ -24,5 +24,5 @@ add_test(JsonArray JsonArrayTests) set_tests_properties(JsonArray PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/add.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/add.cpp index 369bcf2..2708c7d 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/add.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/add.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/clear.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/clear.cpp index baeb022..3a593c5 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/clear.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/clear.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/compare.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/compare.cpp index 4d1c9d0..1e64e16 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/compare.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/compare.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/copyArray.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/copyArray.cpp index a28c5ac..7973c37 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/copyArray.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/copyArray.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/createNested.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/createNested.cpp index dbc4c30..4801dbe 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/createNested.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/createNested.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/equals.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/equals.cpp index f4f9b52..4998d38 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/equals.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/equals.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/isNull.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/isNull.cpp index ad953b9..0da13be 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/isNull.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/isNull.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/iterator.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/iterator.cpp index 435a5bb..50eb276 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/iterator.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/iterator.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/memoryUsage.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/memoryUsage.cpp index 05b743f..9f4ea09 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/memoryUsage.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/memoryUsage.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/nesting.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/nesting.cpp index 2118f5f..fc1be8c 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/nesting.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/nesting.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/remove.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/remove.cpp index b9e86fd..f75efda 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/remove.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/remove.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/size.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/size.cpp index 68b10de..6edd4db 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/size.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/size.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/std_string.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/std_string.cpp index 7af0ac2..7d3ec9f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/std_string.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/std_string.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/subscript.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/subscript.cpp index 57bbe14..3079d2f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/subscript.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/subscript.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonArray/unbound.cpp b/third-party/ArduinoJson/extras/tests/JsonArray/unbound.cpp index 792feec..0e21310 100644 --- a/third-party/ArduinoJson/extras/tests/JsonArray/unbound.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonArray/unbound.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/JsonDeserializer/CMakeLists.txt index 429c375..f60ad41 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(JsonDeserializerTests @@ -24,5 +24,5 @@ add_test(JsonDeserializer JsonDeserializerTests) set_tests_properties(JsonDeserializer PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/DeserializationError.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/DeserializationError.cpp index 01ddaf6..fd1b188 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/DeserializationError.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/DeserializationError.cpp @@ -1,10 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include +#include + void testStringification(DeserializationError error, std::string expected) { REQUIRE(error.c_str() == expected); } diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/array.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/array.cpp index 2e0038e..b30269c 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/array.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/array.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/array_static.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/array_static.cpp index d828518..2d1f538 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/array_static.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/array_static.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/filter.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/filter.cpp index e0c3734..f1c6e2e 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/filter.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/filter.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_ENABLE_COMMENTS 1 diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/incomplete_input.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/incomplete_input.cpp index 4e5bcdb..a34aede 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/incomplete_input.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/incomplete_input.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_DECODE_UNICODE 1 diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/input_types.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/input_types.cpp index 04054c6..6c21c6f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/input_types.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/input_types.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/invalid_input.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/invalid_input.cpp index a2304a3..52b5038 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/invalid_input.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/invalid_input.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_DECODE_UNICODE 1 diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/misc.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/misc.cpp index dc8083c..4f22de1 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/misc.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/misc.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/nestingLimit.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/nestingLimit.cpp index 0cdcb3e..cf55dc8 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/nestingLimit.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/nestingLimit.cpp @@ -1,10 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include +#include + #define SHOULD_WORK(expression) REQUIRE(DeserializationError::Ok == expression); #define SHOULD_FAIL(expression) \ REQUIRE(DeserializationError::TooDeep == expression); diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/number.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/number.cpp index 44e24cb..05cf89e 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/number.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/number.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_USE_LONG_LONG 0 @@ -11,8 +11,8 @@ #include namespace my { -using ARDUINOJSON_NAMESPACE::isinf; -using ARDUINOJSON_NAMESPACE::isnan; +using ArduinoJson::detail::isinf; +using ArduinoJson::detail::isnan; } // namespace my TEST_CASE("deserialize an integer") { diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/object.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/object.cpp index 79b2975..814258e 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/object.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/object.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/object_static.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/object_static.cpp index a326afe..b198ea7 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/object_static.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/object_static.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDeserializer/string.cpp b/third-party/ArduinoJson/extras/tests/JsonDeserializer/string.cpp index 8f93ac6..2379d45 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDeserializer/string.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDeserializer/string.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_DECODE_UNICODE 1 diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/BasicJsonDocument.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/BasicJsonDocument.cpp index d207440..9f034f0 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/BasicJsonDocument.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/BasicJsonDocument.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -8,12 +8,11 @@ #include #include -using ARDUINOJSON_NAMESPACE::addPadding; - class SpyingAllocator { public: SpyingAllocator(const SpyingAllocator& src) : _log(src._log) {} SpyingAllocator(std::ostream& log) : _log(log) {} + SpyingAllocator& operator=(const SpyingAllocator& src) = delete; void* allocate(size_t n) { _log << "A" << n; @@ -25,8 +24,6 @@ class SpyingAllocator { } private: - SpyingAllocator& operator=(const SpyingAllocator& src); - std::ostream& _log; }; @@ -72,7 +69,6 @@ TEST_CASE("BasicJsonDocument") { REQUIRE(log.str() == "A4096A4096FF"); } -#if ARDUINOJSON_HAS_RVALUE_REFERENCES SECTION("Move construct") { { BasicJsonDocument doc1(4096, log); @@ -87,7 +83,6 @@ TEST_CASE("BasicJsonDocument") { } REQUIRE(log.str() == "A4096F"); } -#endif SECTION("Copy assign larger") { { @@ -134,7 +129,6 @@ TEST_CASE("BasicJsonDocument") { REQUIRE(log.str() == "A1024A1024FF"); } -#if ARDUINOJSON_HAS_RVALUE_REFERENCES SECTION("Move assign") { { BasicJsonDocument doc1(4096, log); @@ -150,7 +144,6 @@ TEST_CASE("BasicJsonDocument") { } REQUIRE(log.str() == "A4096A8FF"); } -#endif SECTION("garbageCollect()") { BasicJsonDocument doc(4096); diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/JsonDocument/CMakeLists.txt index 5356780..3e9b468 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(JsonDocumentTests @@ -12,6 +12,7 @@ add_executable(JsonDocumentTests DynamicJsonDocument.cpp ElementProxy.cpp isNull.cpp + issue1120.cpp MemberProxy.cpp nesting.cpp overflowed.cpp @@ -27,5 +28,5 @@ add_test(JsonDocument JsonDocumentTests) set_tests_properties(JsonDocument PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/DynamicJsonDocument.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/DynamicJsonDocument.cpp index ce050f1..397f8c5 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/DynamicJsonDocument.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/DynamicJsonDocument.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using ARDUINOJSON_NAMESPACE::addPadding; +using ArduinoJson::detail::addPadding; static void REQUIRE_JSON(JsonDocument& doc, const std::string& expected) { std::string json; diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/ElementProxy.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/ElementProxy.cpp index eafc85f..00fcdda 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/ElementProxy.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/ElementProxy.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -typedef ARDUINOJSON_NAMESPACE::ElementProxy ElementProxy; +typedef ArduinoJson::detail::ElementProxy ElementProxy; TEST_CASE("ElementProxy::add()") { DynamicJsonDocument doc(4096); diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/MemberProxy.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/MemberProxy.cpp index ed3e32b..a3707b0 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/MemberProxy.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/MemberProxy.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -typedef ARDUINOJSON_NAMESPACE::MemberProxy +typedef ArduinoJson::detail::MemberProxy MemberProxy; TEST_CASE("MemberProxy::add()") { diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/StaticJsonDocument.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/StaticJsonDocument.cpp index fe193e4..0d4089b 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/StaticJsonDocument.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/StaticJsonDocument.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/add.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/add.cpp index 109bd08..5843ac9 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/add.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/add.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/cast.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/cast.cpp index e538f4b..253e1fc 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/cast.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/cast.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/compare.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/compare.cpp index 7e9b950..d834b22 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/compare.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/compare.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/containsKey.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/containsKey.cpp index 6936043..8274fc7 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/containsKey.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/containsKey.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/createNested.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/createNested.cpp index 258f051..0c94357 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/createNested.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/createNested.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/isNull.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/isNull.cpp index cfb70dd..d5aaae0 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/isNull.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/isNull.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Cpp11/issue1120.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/issue1120.cpp similarity index 100% rename from third-party/ArduinoJson/extras/tests/Cpp11/issue1120.cpp rename to third-party/ArduinoJson/extras/tests/JsonDocument/issue1120.cpp diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/nesting.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/nesting.cpp index 3284dd1..7ac7e76 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/nesting.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/nesting.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/overflowed.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/overflowed.cpp index cea0db9..e46d21b 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/overflowed.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/overflowed.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/remove.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/remove.cpp index b777073..724b324 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/remove.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/remove.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/shrinkToFit.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/shrinkToFit.cpp index 0eb34e8..cc76972 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/shrinkToFit.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/shrinkToFit.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -8,8 +8,6 @@ #include // malloc, free #include -using ARDUINOJSON_NAMESPACE::addPadding; - class ArmoredAllocator { public: ArmoredAllocator() : _ptr(0), _size(0) {} diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/size.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/size.cpp index 4fbb6e2..b3205a1 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/size.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/size.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonDocument/subscript.cpp b/third-party/ArduinoJson/extras/tests/JsonDocument/subscript.cpp index 4ba6ff8..f4186f8 100644 --- a/third-party/ArduinoJson/extras/tests/JsonDocument/subscript.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonDocument/subscript.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/JsonObject/CMakeLists.txt index 033e73e..8676811 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/JsonObject/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(JsonObjectTests @@ -25,5 +25,5 @@ add_test(JsonObject JsonObjectTests) set_tests_properties(JsonObject PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/clear.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/clear.cpp index da17b2c..e112a8d 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/clear.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/clear.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/compare.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/compare.cpp index ffdb9aa..9b747e3 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/compare.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/compare.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/containsKey.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/containsKey.cpp index 4f37f7e..85335a8 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/containsKey.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/containsKey.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/copy.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/copy.cpp index c5514a2..a4d5b5f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/copy.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/copy.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/createNestedArray.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/createNestedArray.cpp index 4d43038..26c1a86 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/createNestedArray.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/createNestedArray.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/createNestedObject.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/createNestedObject.cpp index 29f4d39..9ea067a 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/createNestedObject.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/createNestedObject.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/equals.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/equals.cpp index 101c612..02d451f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/equals.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/equals.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/invalid.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/invalid.cpp index 199c8f0..0695b48 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/invalid.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/invalid.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/isNull.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/isNull.cpp index 4440348..9fdff95 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/isNull.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/isNull.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/iterator.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/iterator.cpp index e9f2cd2..c48de5f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/iterator.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/iterator.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/memoryUsage.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/memoryUsage.cpp index 835ee4a..406bcda 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/memoryUsage.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/memoryUsage.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/nesting.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/nesting.cpp index 7937c28..2ba98ad 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/nesting.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/nesting.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/remove.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/remove.cpp index f1cb20c..1dbd4bd 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/remove.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/remove.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/size.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/size.cpp index 0d82cfb..d9c7bb7 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/size.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/size.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/std_string.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/std_string.cpp index bc74d01..8a93d3f 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/std_string.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/std_string.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonObject/subscript.cpp b/third-party/ArduinoJson/extras/tests/JsonObject/subscript.cpp index e8242f6..afc567a 100644 --- a/third-party/ArduinoJson/extras/tests/JsonObject/subscript.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonObject/subscript.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/JsonSerializer/CMakeLists.txt index ece6dbc..0ec4937 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(JsonSerializerTests @@ -18,5 +18,5 @@ add_test(JsonSerializer JsonSerializerTests) set_tests_properties(JsonSerializer PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/CustomWriter.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/CustomWriter.cpp index d4ba459..b6d8be7 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/CustomWriter.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/CustomWriter.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -8,6 +8,8 @@ class CustomWriter { public: CustomWriter() {} + CustomWriter(const CustomWriter&) = delete; + CustomWriter& operator=(const CustomWriter&) = delete; size_t write(uint8_t c) { _str.append(1, static_cast(c)); @@ -24,9 +26,6 @@ class CustomWriter { } private: - CustomWriter(const CustomWriter&); // non-copiable - CustomWriter& operator=(const CustomWriter&); - std::string _str; }; diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArray.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArray.cpp index 7cecbf4..1fad69d 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArray.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArray.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArrayPretty.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArrayPretty.cpp index 8c319fc..9abeb01 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArrayPretty.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonArrayPretty.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObject.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObject.cpp index 20b90f5..9ba2114 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObject.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObject.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObjectPretty.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObjectPretty.cpp index ec4ae71..4e8d113 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObjectPretty.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonObjectPretty.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonVariant.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonVariant.cpp index 3525a1a..81553d3 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonVariant.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/JsonVariant.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/std_stream.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/std_stream.cpp index 7452028..411f479 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/std_stream.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/std_stream.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonSerializer/std_string.cpp b/third-party/ArduinoJson/extras/tests/JsonSerializer/std_string.cpp index 7a145da..af0d809 100644 --- a/third-party/ArduinoJson/extras/tests/JsonSerializer/std_string.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonSerializer/std_string.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/JsonVariant/CMakeLists.txt index 1a0d14a..d43a971 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(JsonVariantTests @@ -16,12 +16,14 @@ add_executable(JsonVariantTests memoryUsage.cpp misc.cpp nesting.cpp + nullptr.cpp or.cpp overflow.cpp remove.cpp set.cpp shallowCopy.cpp size.cpp + stl_containers.cpp subscript.cpp types.cpp unbound.cpp @@ -31,5 +33,5 @@ add_test(JsonVariant JsonVariantTests) set_tests_properties(JsonVariant PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/add.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/add.cpp index 526e914..6907ae3 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/add.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/add.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/as.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/as.cpp index c995677..01e263e 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/as.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/as.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -7,7 +7,7 @@ #include namespace my { -using ARDUINOJSON_NAMESPACE::isinf; +using ArduinoJson::detail::isinf; } // namespace my enum MY_ENUM { ONE = 1, TWO = 2 }; diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/clear.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/clear.cpp index 2b40e32..d516ca6 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/clear.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/clear.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/compare.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/compare.cpp index 2cbdaa3..1922df0 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/compare.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/compare.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/containsKey.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/containsKey.cpp index fca684e..d003d11 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/containsKey.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/containsKey.cpp @@ -1,13 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -static const char* null = 0; - TEST_CASE("JsonVariant::containsKey()") { DynamicJsonDocument doc(4096); JsonVariant var = doc.to(); diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/converters.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/converters.cpp index 7281f2b..4de066a 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/converters.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/converters.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -88,7 +88,7 @@ class Complex { double _real, _imag; }; -namespace ARDUINOJSON_NAMESPACE { +namespace ArduinoJson { template <> struct Converter { static void toJson(const Complex& src, JsonVariant dst) { @@ -104,7 +104,7 @@ struct Converter { return src["real"].is() && src["imag"].is(); } }; -} // namespace ARDUINOJSON_NAMESPACE +} // namespace ArduinoJson TEST_CASE("Custom converter with specialization") { DynamicJsonDocument doc(4096); @@ -142,7 +142,7 @@ TEST_CASE("Custom converter with specialization") { } TEST_CASE("ConverterNeedsWriteableRef") { - using namespace ARDUINOJSON_NAMESPACE; + using namespace ArduinoJson::detail; CHECK(ConverterNeedsWriteableRef::value == false); CHECK(ConverterNeedsWriteableRef::value == false); CHECK(ConverterNeedsWriteableRef::value == true); diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/copy.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/copy.cpp index 7784f0c..0d96bf9 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/copy.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/copy.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/createNested.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/createNested.cpp index efd7501..e395823 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/createNested.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/createNested.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/is.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/is.cpp index 479e923..6a414a4 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/is.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/is.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/isnull.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/isnull.cpp index 1ec6f35..bb9de71 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/isnull.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/isnull.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/memoryUsage.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/memoryUsage.cpp index 59587db..808acb3 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/memoryUsage.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/memoryUsage.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/misc.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/misc.cpp index 05976c3..91489f9 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/misc.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/misc.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/nesting.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/nesting.cpp index 3e936fb..1028a28 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/nesting.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/nesting.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Cpp11/nullptr.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/nullptr.cpp similarity index 75% rename from third-party/ArduinoJson/extras/tests/Cpp11/nullptr.cpp rename to third-party/ArduinoJson/extras/tests/JsonVariant/nullptr.cpp index 813b9cc..e26d930 100644 --- a/third-party/ArduinoJson/extras/tests/Cpp11/nullptr.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/nullptr.cpp @@ -2,24 +2,20 @@ #include -#if !ARDUINOJSON_HAS_NULLPTR -# error ARDUINOJSON_HAS_NULLPTR must be set to 1 -#endif - TEST_CASE("nullptr") { DynamicJsonDocument doc(4096); JsonVariant variant = doc.to(); SECTION("JsonVariant == nullptr") { - REQUIRE((variant == nullptr)); - REQUIRE_FALSE((variant != nullptr)); + REQUIRE(variant == nullptr); + REQUIRE_FALSE(variant != nullptr); } SECTION("JsonVariant != nullptr") { variant.set(42); - REQUIRE_FALSE((variant == nullptr)); - REQUIRE((variant != nullptr)); + REQUIRE_FALSE(variant == nullptr); + REQUIRE(variant != nullptr); } SECTION("JsonVariant.set(nullptr)") { diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/or.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/or.cpp index 7d1c190..01ec470 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/or.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/or.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/overflow.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/overflow.cpp index ff0e3aa..1123e98 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/overflow.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/overflow.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/remove.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/remove.cpp index c744e19..0835bf0 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/remove.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/remove.cpp @@ -1,13 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -static const char* null = 0; - TEST_CASE("JsonVariant::remove()") { DynamicJsonDocument doc(4096); JsonVariant var = doc.to(); diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/set.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/set.cpp index 9188c98..4743afb 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/set.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/set.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/shallowCopy.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/shallowCopy.cpp index c7c334b..28aa38c 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/shallowCopy.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/shallowCopy.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/size.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/size.cpp index 73d9ced..3a4ec46 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/size.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/size.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Cpp11/stl_containers.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/stl_containers.cpp similarity index 87% rename from third-party/ArduinoJson/extras/tests/Cpp11/stl_containers.cpp rename to third-party/ArduinoJson/extras/tests/JsonVariant/stl_containers.cpp index 4c664e7..d6b9b60 100644 --- a/third-party/ArduinoJson/extras/tests/Cpp11/stl_containers.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/stl_containers.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -10,9 +10,9 @@ #include #include -namespace ARDUINOJSON_NAMESPACE { +namespace ArduinoJson { template -struct Converter > { +struct Converter> { static void toJson(const std::vector& src, JsonVariant dst) { JsonArray array = dst.to(); for (T item : src) @@ -36,7 +36,7 @@ struct Converter > { }; template -struct Converter > { +struct Converter> { static void toJson(const std::array& src, JsonVariant dst) { JsonArray array = dst.to(); for (T item : src) @@ -63,7 +63,7 @@ struct Converter > { return result && size == N; } }; -} // namespace ARDUINOJSON_NAMESPACE +} // namespace ArduinoJson TEST_CASE("vector") { SECTION("toJson") { @@ -79,7 +79,7 @@ TEST_CASE("vector") { doc.add(1); doc.add(2); - auto v = doc.as >(); + auto v = doc.as>(); REQUIRE(v.size() == 2); CHECK(v[0] == 1); CHECK(v[1] == 2); @@ -87,14 +87,14 @@ TEST_CASE("vector") { SECTION("checkJson") { StaticJsonDocument<128> doc; - CHECK(doc.is >() == false); + CHECK(doc.is>() == false); doc.add(1); doc.add(2); - CHECK(doc.is >() == true); + CHECK(doc.is>() == true); doc.add("foo"); - CHECK(doc.is >() == false); + CHECK(doc.is>() == false); } } diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/subscript.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/subscript.cpp index f466cd2..93f759b 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/subscript.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/subscript.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/types.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/types.cpp index e379499..4224299 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/types.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/types.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/JsonVariant/unbound.cpp b/third-party/ArduinoJson/extras/tests/JsonVariant/unbound.cpp index 8089e1c..9020323 100644 --- a/third-party/ArduinoJson/extras/tests/JsonVariant/unbound.cpp +++ b/third-party/ArduinoJson/extras/tests/JsonVariant/unbound.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MemoryPool/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/MemoryPool/CMakeLists.txt index 80ba3c6..2f809cc 100644 --- a/third-party/ArduinoJson/extras/tests/MemoryPool/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/MemoryPool/CMakeLists.txt @@ -1,8 +1,8 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License -add_executable(MemoryPoolTests +add_executable(MemoryPoolTests allocVariant.cpp clear.cpp saveString.cpp @@ -14,5 +14,5 @@ add_test(MemoryPool MemoryPoolTests) set_tests_properties(MemoryPool PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/MemoryPool/StringCopier.cpp b/third-party/ArduinoJson/extras/tests/MemoryPool/StringCopier.cpp index c615905..0342bc4 100644 --- a/third-party/ArduinoJson/extras/tests/MemoryPool/StringCopier.cpp +++ b/third-party/ArduinoJson/extras/tests/MemoryPool/StringCopier.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("StringCopier") { char buffer[4096]; diff --git a/third-party/ArduinoJson/extras/tests/MemoryPool/allocVariant.cpp b/third-party/ArduinoJson/extras/tests/MemoryPool/allocVariant.cpp index 606d6d7..5123a4e 100644 --- a/third-party/ArduinoJson/extras/tests/MemoryPool/allocVariant.cpp +++ b/third-party/ArduinoJson/extras/tests/MemoryPool/allocVariant.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("MemoryPool::allocVariant()") { char buffer[4096]; diff --git a/third-party/ArduinoJson/extras/tests/MemoryPool/clear.cpp b/third-party/ArduinoJson/extras/tests/MemoryPool/clear.cpp index 66e7775..9e33b47 100644 --- a/third-party/ArduinoJson/extras/tests/MemoryPool/clear.cpp +++ b/third-party/ArduinoJson/extras/tests/MemoryPool/clear.cpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; static const size_t poolCapacity = 512; diff --git a/third-party/ArduinoJson/extras/tests/MemoryPool/saveString.cpp b/third-party/ArduinoJson/extras/tests/MemoryPool/saveString.cpp index 7e0548c..ba8d5b9 100644 --- a/third-party/ArduinoJson/extras/tests/MemoryPool/saveString.cpp +++ b/third-party/ArduinoJson/extras/tests/MemoryPool/saveString.cpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; static const char* saveString(MemoryPool& pool, const char* s) { return pool.saveString(adaptString(const_cast(s))); diff --git a/third-party/ArduinoJson/extras/tests/MemoryPool/size.cpp b/third-party/ArduinoJson/extras/tests/MemoryPool/size.cpp index 5179b10..057f4ab 100644 --- a/third-party/ArduinoJson/extras/tests/MemoryPool/size.cpp +++ b/third-party/ArduinoJson/extras/tests/MemoryPool/size.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("MemoryPool::capacity()") { char buffer[4096]; diff --git a/third-party/ArduinoJson/extras/tests/Misc/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/Misc/CMakeLists.txt index d567efb..5655a08 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/Misc/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(MiscTests @@ -25,5 +25,5 @@ add_test(Misc MiscTests) set_tests_properties(Misc PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/Misc/FloatParts.cpp b/third-party/ArduinoJson/extras/tests/Misc/FloatParts.cpp index 736b176..8e3d82e 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/FloatParts.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/FloatParts.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("FloatParts") { SECTION("1.7976931348623157E+308") { diff --git a/third-party/ArduinoJson/extras/tests/Misc/JsonString.cpp b/third-party/ArduinoJson/extras/tests/Misc/JsonString.cpp index 557f993..c3dca17 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/JsonString.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/JsonString.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Misc/NoArduinoHeader.cpp b/third-party/ArduinoJson/extras/tests/Misc/NoArduinoHeader.cpp index 43a82b2..4b0218b 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/NoArduinoHeader.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/NoArduinoHeader.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINO 1 diff --git a/third-party/ArduinoJson/extras/tests/Misc/Readers.cpp b/third-party/ArduinoJson/extras/tests/Misc/Readers.cpp index e46ad1e..bd04e16 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/Readers.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/Readers.cpp @@ -1,12 +1,14 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -using namespace ARDUINOJSON_NAMESPACE; +#include + +using namespace ArduinoJson::detail; TEST_CASE("Reader") { SECTION("read()") { diff --git a/third-party/ArduinoJson/extras/tests/Misc/StringAdapters.cpp b/third-party/ArduinoJson/extras/tests/Misc/StringAdapters.cpp index 03c4196..cc6d681 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/StringAdapters.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/StringAdapters.cpp @@ -1,9 +1,8 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_ENABLE_PROGMEM 1 -#define ARDUINOJSON_ENABLE_ARDUINO_STRING 1 #include "custom_string.hpp" #include "progmem_emulation.hpp" @@ -14,7 +13,7 @@ #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("ZeroTerminatedRamString") { SECTION("null") { @@ -91,13 +90,13 @@ struct EmptyStruct {}; TEST_CASE("IsString") { CHECK(IsString::value == true); - CHECK(IsString >::value == false); + CHECK(IsString>::value == false); CHECK(IsString::value == true); CHECK(IsString::value == true); CHECK(IsString::value == true); CHECK(IsString::value == true); - CHECK(IsString< ::String>::value == true); - CHECK(IsString< ::StringSumHelper>::value == true); + CHECK(IsString<::String>::value == true); + CHECK(IsString<::StringSumHelper>::value == true); CHECK(IsString::value == false); } diff --git a/third-party/ArduinoJson/extras/tests/Misc/StringWriter.cpp b/third-party/ArduinoJson/extras/tests/Misc/StringWriter.cpp index bdb5bdb..3cc1333 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/StringWriter.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/StringWriter.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_ENABLE_ARDUINO_STRING 1 @@ -8,7 +8,7 @@ #include #include "custom_string.hpp" -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; template static size_t print(StringWriter& writer, const char* s) { @@ -65,7 +65,7 @@ TEST_CASE("Writer") { TEST_CASE("Writer") { ::String output; - Writer< ::String> writer(output); + Writer<::String> writer(output); SECTION("write(char)") { SECTION("writes to temporary buffer") { diff --git a/third-party/ArduinoJson/extras/tests/Misc/TypeTraits.cpp b/third-party/ArduinoJson/extras/tests/Misc/TypeTraits.cpp index 76ec486..10b6168 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/TypeTraits.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/TypeTraits.cpp @@ -1,11 +1,13 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +#include + +using namespace ArduinoJson::detail; class EmptyClass {}; enum EmptyEnum {}; @@ -19,9 +21,9 @@ TEST_CASE("Polyfills/type_traits") { } SECTION("is_array") { - REQUIRE_FALSE((is_array::value)); - REQUIRE((is_array::value)); - REQUIRE((is_array::value)); + REQUIRE_FALSE(is_array::value); + REQUIRE(is_array::value); + REQUIRE(is_array::value); } SECTION("is_const") { @@ -172,36 +174,35 @@ TEST_CASE("Polyfills/type_traits") { } SECTION("is_convertible") { - CHECK((is_convertible::value == true)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible::value == false)); - CHECK((is_convertible::value == false)); - - CHECK((is_convertible::value == - false)); - CHECK((is_convertible::value == false)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible, JsonVariantConst>::value == - true)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible::value == true)); - CHECK((is_convertible, - JsonVariantConst>::value == true)); - CHECK((is_convertible::value == true)); - CHECK( - (is_convertible::value == true)); - CHECK((is_convertible, JsonVariantConst>::value == - true)); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == false); + CHECK(is_convertible::value == false); + + CHECK(is_convertible::value == + false); + CHECK(is_convertible::value == false); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible, JsonVariantConst>::value == + true); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible, + JsonVariantConst>::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible::value == true); + CHECK(is_convertible, JsonVariantConst>::value == + true); } SECTION("is_class") { - CHECK((is_class::value == false)); - CHECK((is_class::value == false)); - CHECK((is_class::value == false)); - CHECK((is_class::value == true)); + CHECK(is_class::value == false); + CHECK(is_class::value == false); + CHECK(is_class::value == false); + CHECK(is_class::value == true); } SECTION("is_enum") { diff --git a/third-party/ArduinoJson/extras/tests/Misc/Utf16.cpp b/third-party/ArduinoJson/extras/tests/Misc/Utf16.cpp index 31ab7ec..3a59591 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/Utf16.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/Utf16.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; static void testUtf16Codepoint(uint16_t codeunit, uint32_t expectedCodepoint) { Utf16::Codepoint cp; diff --git a/third-party/ArduinoJson/extras/tests/Misc/Utf8.cpp b/third-party/ArduinoJson/extras/tests/Misc/Utf8.cpp index b44028a..0c62033 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/Utf8.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/Utf8.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -7,7 +7,7 @@ #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; static void testCodepoint(uint32_t codepoint, std::string expected) { char buffer[4096]; diff --git a/third-party/ArduinoJson/extras/tests/Misc/arithmeticCompare.cpp b/third-party/ArduinoJson/extras/tests/Misc/arithmeticCompare.cpp index a67943e..2d51754 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/arithmeticCompare.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/arithmeticCompare.cpp @@ -1,103 +1,97 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("arithmeticCompare()") { SECTION("int vs uint8_t") { - CHECK((arithmeticCompare(256, 1) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(41, 42) == COMPARE_RESULT_LESS)); - CHECK((arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(43, 42) == COMPARE_RESULT_GREATER)); + CHECK(arithmeticCompare(256, 1) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(41, 42) == COMPARE_RESULT_LESS); + CHECK(arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(43, 42) == COMPARE_RESULT_GREATER); } SECTION("unsigned vs int") { - CHECK((arithmeticCompare(0, -1) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(42, 41) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(42, 43) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompare(0, -1) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(42, 41) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(42, 43) == COMPARE_RESULT_LESS); } SECTION("float vs int") { - CHECK((arithmeticCompare(42, 41) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(42, 43) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompare(42, 41) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(42, 43) == COMPARE_RESULT_LESS); } SECTION("int vs unsigned") { - CHECK((arithmeticCompare(-1, 0) == COMPARE_RESULT_LESS)); - CHECK((arithmeticCompare(0, 0) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(1, 0) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(42, 41) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(42, 43) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompare(-1, 0) == COMPARE_RESULT_LESS); + CHECK(arithmeticCompare(0, 0) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(1, 0) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(42, 41) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(42, 42) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(42, 43) == COMPARE_RESULT_LESS); } SECTION("unsigned vs unsigned") { - CHECK((arithmeticCompare(42, 41) == - COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(42, 42) == - COMPARE_RESULT_EQUAL)); - CHECK( - (arithmeticCompare(42, 43) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompare(42, 41) == + COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(42, 42) == + COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(42, 43) == COMPARE_RESULT_LESS); } SECTION("bool vs bool") { - CHECK( - (arithmeticCompare(false, false) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(true, true) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(false, true) == COMPARE_RESULT_LESS)); - CHECK( - (arithmeticCompare(true, false) == COMPARE_RESULT_GREATER)); + CHECK(arithmeticCompare(false, false) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(true, true) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(false, true) == COMPARE_RESULT_LESS); + CHECK(arithmeticCompare(true, false) == COMPARE_RESULT_GREATER); } SECTION("bool vs int") { - CHECK((arithmeticCompare(false, -1) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(false, 0) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(false, 1) == COMPARE_RESULT_LESS)); - CHECK((arithmeticCompare(true, 0) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(true, 1) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(true, 2) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompare(false, -1) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(false, 0) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(false, 1) == COMPARE_RESULT_LESS); + CHECK(arithmeticCompare(true, 0) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(true, 1) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(true, 2) == COMPARE_RESULT_LESS); } SECTION("bool vs int") { - CHECK((arithmeticCompare(0, false) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(1, true) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompare(1, false) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompare(0, true) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompare(0, false) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(1, true) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompare(1, false) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompare(0, true) == COMPARE_RESULT_LESS); } } TEST_CASE("arithmeticCompareNegateLeft()") { SECTION("unsigned vs int") { - CHECK((arithmeticCompareNegateLeft(0, 1) == COMPARE_RESULT_LESS)); - CHECK((arithmeticCompareNegateLeft(42, -41) == COMPARE_RESULT_LESS)); - CHECK((arithmeticCompareNegateLeft(42, -42) == COMPARE_RESULT_EQUAL)); - CHECK( - (arithmeticCompareNegateLeft(42, -43) == COMPARE_RESULT_GREATER)); + CHECK(arithmeticCompareNegateLeft(0, 1) == COMPARE_RESULT_LESS); + CHECK(arithmeticCompareNegateLeft(42, -41) == COMPARE_RESULT_LESS); + CHECK(arithmeticCompareNegateLeft(42, -42) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompareNegateLeft(42, -43) == COMPARE_RESULT_GREATER); } SECTION("unsigned vs unsigned") { - CHECK( - (arithmeticCompareNegateLeft(42, 42) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompareNegateLeft(42, 42) == COMPARE_RESULT_LESS); } } TEST_CASE("arithmeticCompareNegateRight()") { SECTION("int vs unsigned") { - CHECK((arithmeticCompareNegateRight(1, 0) == COMPARE_RESULT_GREATER)); - CHECK( - (arithmeticCompareNegateRight(-41, 42) == COMPARE_RESULT_GREATER)); - CHECK((arithmeticCompareNegateRight(-42, 42) == COMPARE_RESULT_EQUAL)); - CHECK((arithmeticCompareNegateRight(-43, 42) == COMPARE_RESULT_LESS)); + CHECK(arithmeticCompareNegateRight(1, 0) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompareNegateRight(-41, 42) == COMPARE_RESULT_GREATER); + CHECK(arithmeticCompareNegateRight(-42, 42) == COMPARE_RESULT_EQUAL); + CHECK(arithmeticCompareNegateRight(-43, 42) == COMPARE_RESULT_LESS); } SECTION("unsigned vs unsigned") { - CHECK((arithmeticCompareNegateRight(42, 42) == - COMPARE_RESULT_GREATER)); + CHECK(arithmeticCompareNegateRight(42, 42) == + COMPARE_RESULT_GREATER); } } diff --git a/third-party/ArduinoJson/extras/tests/Misc/conflicts.cpp b/third-party/ArduinoJson/extras/tests/Misc/conflicts.cpp index 991a94e..0956682 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/conflicts.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/conflicts.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License // Include any header that might use the conflicting macros diff --git a/third-party/ArduinoJson/extras/tests/Misc/custom_string.hpp b/third-party/ArduinoJson/extras/tests/Misc/custom_string.hpp index 3c5b7c1..4a6a5a7 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/custom_string.hpp +++ b/third-party/ArduinoJson/extras/tests/Misc/custom_string.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #pragma once diff --git a/third-party/ArduinoJson/extras/tests/Misc/printable.cpp b/third-party/ArduinoJson/extras/tests/Misc/printable.cpp index 7cec8f9..0c6e8e1 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/printable.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/printable.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Misc/unsigned_char.cpp b/third-party/ArduinoJson/extras/tests/Misc/unsigned_char.cpp index 7a5e3ee..d3ee492 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/unsigned_char.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/unsigned_char.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Misc/version.cpp b/third-party/ArduinoJson/extras/tests/Misc/version.cpp index 486a867..a91f159 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/version.cpp +++ b/third-party/ArduinoJson/extras/tests/Misc/version.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Misc/weird_strcmp.hpp b/third-party/ArduinoJson/extras/tests/Misc/weird_strcmp.hpp index ff755ef..5463d7e 100644 --- a/third-party/ArduinoJson/extras/tests/Misc/weird_strcmp.hpp +++ b/third-party/ArduinoJson/extras/tests/Misc/weird_strcmp.hpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -8,7 +8,8 @@ // Issue #1198: strcmp() implementation that returns a value larger than 8-bit -namespace ARDUINOJSON_NAMESPACE { +ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE + int strcmp(const char* a, const char* b) { int result = ::strcmp(a, b); if (result > 0) @@ -26,4 +27,5 @@ int strncmp(const char* a, const char* b, size_t n) { return -214748364; return 0; } -} // namespace ARDUINOJSON_NAMESPACE + +ARDUINOJSON_END_PRIVATE_NAMESPACE diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/MixedConfiguration/CMakeLists.txt index 01d1216..c2c9dc5 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(MixedConfigurationTests @@ -19,6 +19,8 @@ add_executable(MixedConfigurationTests issue1707.cpp use_double_0.cpp use_double_1.cpp + use_long_long_0.cpp + use_long_long_1.cpp ) set_target_properties(MixedConfigurationTests PROPERTIES UNITY_BUILD OFF) @@ -27,5 +29,5 @@ add_test(MixedConfiguration MixedConfigurationTests) set_tests_properties(MixedConfiguration PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_0.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_0.cpp index 426f516..569f84a 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_0.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_0.cpp @@ -1,11 +1,11 @@ -#define ARDUINOJSON_NAMESPACE ArduinoJson_NoAlignment +#define ARDUINOJSON_VERSION_NAMESPACE NoAlignment #define ARDUINOJSON_ENABLE_ALIGNMENT 0 #include #include TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 0") { - using namespace ARDUINOJSON_NAMESPACE; + using namespace ArduinoJson::detail; const size_t N = sizeof(void*); diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_1.cpp index 9abf50c..56d4816 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_1.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_alignment_1.cpp @@ -4,7 +4,7 @@ #include TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 1") { - using namespace ARDUINOJSON_NAMESPACE; + using namespace ArduinoJson::detail; const size_t N = sizeof(void*); diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_0.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_0.cpp index 6329021..a3ada5e 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_0.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_0.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_ENABLE_COMMENTS 0 diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_1.cpp index 1846292..5e0831c 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_1.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_comments_1.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_ENABLE_COMMENTS 1 diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_infinity_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_infinity_1.cpp index 19e0d5b..28a3461 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_infinity_1.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_infinity_1.cpp @@ -5,7 +5,7 @@ #include namespace my { -using ARDUINOJSON_NAMESPACE::isinf; +using ArduinoJson::detail::isinf; } // namespace my TEST_CASE("ARDUINOJSON_ENABLE_INFINITY == 1") { diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_nan_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_nan_1.cpp index 34d94fc..f9ae04a 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_nan_1.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_nan_1.cpp @@ -5,7 +5,7 @@ #include namespace my { -using ARDUINOJSON_NAMESPACE::isnan; +using ArduinoJson::detail::isnan; } // namespace my TEST_CASE("ARDUINOJSON_ENABLE_NAN == 1") { diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_progmem_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_progmem_1.cpp index 61e6c28..92a3cbf 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_progmem_1.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_progmem_1.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include "progmem_emulation.hpp" @@ -53,7 +53,7 @@ TEST_CASE("Flash strings") { } TEST_CASE("parseNumber()") { // tables are in Flash - using ARDUINOJSON_NAMESPACE::parseNumber; + using ArduinoJson::detail::parseNumber; CHECK(parseNumber("1") == 1.f); CHECK(parseNumber("1.23") == 1.23f); @@ -95,7 +95,7 @@ TEST_CASE("memcpy_P") { } TEST_CASE("BoundedReader") { - using namespace ARDUINOJSON_NAMESPACE; + using namespace ArduinoJson::detail; SECTION("read") { BoundedReader reader(F("\x01\xFF"), 2); @@ -135,7 +135,7 @@ TEST_CASE("BoundedReader") { } TEST_CASE("Reader") { - using namespace ARDUINOJSON_NAMESPACE; + using namespace ArduinoJson::detail; SECTION("read()") { Reader reader(F("\x01\xFF\x00\x12")); diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_0.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_0.cpp index 4adb5ca..d763eec 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_0.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_0.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include "progmem_emulation.hpp" diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_1.cpp index 0059777..a8388a9 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_1.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/enable_string_deduplication_1.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include "progmem_emulation.hpp" diff --git a/third-party/ArduinoJson/extras/tests/MixedConfiguration/issue1707.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/issue1707.cpp index fce024c..f3ab7f9 100644 --- a/third-party/ArduinoJson/extras/tests/MixedConfiguration/issue1707.cpp +++ b/third-party/ArduinoJson/extras/tests/MixedConfiguration/issue1707.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINO diff --git a/third-party/ArduinoJson/extras/tests/Cpp11/use_long_long_0.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/use_long_long_0.cpp similarity index 100% rename from third-party/ArduinoJson/extras/tests/Cpp11/use_long_long_0.cpp rename to third-party/ArduinoJson/extras/tests/MixedConfiguration/use_long_long_0.cpp diff --git a/third-party/ArduinoJson/extras/tests/Cpp11/use_long_long_1.cpp b/third-party/ArduinoJson/extras/tests/MixedConfiguration/use_long_long_1.cpp similarity index 100% rename from third-party/ArduinoJson/extras/tests/Cpp11/use_long_long_1.cpp rename to third-party/ArduinoJson/extras/tests/MixedConfiguration/use_long_long_1.cpp diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/CMakeLists.txt index f243527..a544207 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(MsgPackDeserializerTests @@ -20,5 +20,5 @@ add_test(MsgPackDeserializer MsgPackDeserializerTests) set_tests_properties(MsgPackDeserializer PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeArray.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeArray.cpp index 4540bd0..356a9fe 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeArray.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeArray.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeObject.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeObject.cpp index 7a0e7b8..4aeb553 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeObject.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeObject.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeStaticVariant.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeStaticVariant.cpp index 2d4093c..0e126ff 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeStaticVariant.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeStaticVariant.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeVariant.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeVariant.cpp index be20b9c..87f38d6 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeVariant.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/deserializeVariant.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/doubleToFloat.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/doubleToFloat.cpp index b0470de..fb2c25d 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/doubleToFloat.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/doubleToFloat.cpp @@ -1,11 +1,11 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; template static void check(const char* input, T expected) { diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/filter.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/filter.cpp index 57dd7be..78700db 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/filter.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/filter.cpp @@ -1,11 +1,13 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +#include + +using namespace ArduinoJson::detail; TEST_CASE("deserializeMsgPack() filter") { StaticJsonDocument<4096> doc; diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/incompleteInput.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/incompleteInput.cpp index 029facf..6a56388 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/incompleteInput.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/incompleteInput.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/input_types.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/input_types.cpp index f46d469..783aaa2 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/input_types.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/input_types.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/misc.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/misc.cpp index 0717171..25137b3 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/misc.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/misc.cpp @@ -1,10 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include +#include + TEST_CASE("deserializeMsgPack() returns EmptyInput") { StaticJsonDocument<100> doc; diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/nestingLimit.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/nestingLimit.cpp index 6005f55..2936415 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/nestingLimit.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/nestingLimit.cpp @@ -1,10 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include +#include + #define SHOULD_WORK(expression) REQUIRE(DeserializationError::Ok == expression); #define SHOULD_FAIL(expression) \ REQUIRE(DeserializationError::TooDeep == expression); diff --git a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/notSupported.cpp b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/notSupported.cpp index 5e204cd..2be0f1e 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/notSupported.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackDeserializer/notSupported.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/CMakeLists.txt index 9a7721e..2f3d8cc 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/CMakeLists.txt @@ -1,5 +1,5 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License add_executable(MsgPackSerializerTests @@ -15,5 +15,5 @@ add_test(MsgPackSerializer MsgPackSerializerTests) set_tests_properties(MsgPackSerializer PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/destination_types.cpp b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/destination_types.cpp index 6a5bc84..8b0dffa 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/destination_types.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/destination_types.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/measure.cpp b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/measure.cpp index d49bcd9..a6a4fc9 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/measure.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/measure.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeArray.cpp b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeArray.cpp index 58eae9c..a8ec639 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeArray.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeArray.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeObject.cpp b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeObject.cpp index e5c167a..8817307 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeObject.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeObject.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeVariant.cpp b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeVariant.cpp index c091959..b8a021f 100644 --- a/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeVariant.cpp +++ b/third-party/ArduinoJson/extras/tests/MsgPackSerializer/serializeVariant.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include diff --git a/third-party/ArduinoJson/extras/tests/Numbers/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/Numbers/CMakeLists.txt index 05e1e89..48cf8c0 100644 --- a/third-party/ArduinoJson/extras/tests/Numbers/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/Numbers/CMakeLists.txt @@ -1,10 +1,7 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED OFF) - add_executable(NumbersTests convertNumber.cpp parseFloat.cpp @@ -13,10 +10,9 @@ add_executable(NumbersTests parseNumber.cpp ) - add_test(Numbers NumbersTests) set_tests_properties(Numbers PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/Numbers/convertNumber.cpp b/third-party/ArduinoJson/extras/tests/Numbers/convertNumber.cpp index 8c193dc..ca0cc5e 100644 --- a/third-party/ArduinoJson/extras/tests/Numbers/convertNumber.cpp +++ b/third-party/ArduinoJson/extras/tests/Numbers/convertNumber.cpp @@ -1,136 +1,131 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; TEST_CASE("canConvertNumber()") { SECTION("int8_t -> int8_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(-128)) == true); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(-128) == true); } SECTION("int8_t -> int16_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(-128)) == true); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(-128) == true); } SECTION("int8_t -> uint8_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(-128)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(-128) == false); } SECTION("int8_t -> uint16_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(-128)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(-128) == false); } SECTION("int16_t -> int8_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(128)) == false); - CHECK((canConvertNumber(-128)) == true); - CHECK((canConvertNumber(-129)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(128) == false); + CHECK(canConvertNumber(-128) == true); + CHECK(canConvertNumber(-129) == false); } SECTION("int16_t -> uint8_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(255)) == true); - CHECK((canConvertNumber(256)) == false); - CHECK((canConvertNumber(-1)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(255) == true); + CHECK(canConvertNumber(256) == false); + CHECK(canConvertNumber(-1) == false); } SECTION("uint8_t -> int8_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(128)) == false); - CHECK((canConvertNumber(255)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(128) == false); + CHECK(canConvertNumber(255) == false); } SECTION("uint8_t -> int16_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(128)) == true); - CHECK((canConvertNumber(255)) == true); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(128) == true); + CHECK(canConvertNumber(255) == true); } SECTION("uint8_t -> uint8_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(128)) == true); - CHECK((canConvertNumber(255)) == true); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(128) == true); + CHECK(canConvertNumber(255) == true); } SECTION("uint8_t -> uint16_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(127)) == true); - CHECK((canConvertNumber(128)) == true); - CHECK((canConvertNumber(255)) == true); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(127) == true); + CHECK(canConvertNumber(128) == true); + CHECK(canConvertNumber(255) == true); } SECTION("float -> int32_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-2.147483904e9f)) == false); - CHECK((canConvertNumber(-2.147483648e+9f)) == true); - CHECK((canConvertNumber(2.14748352e+9f)) == true); - CHECK((canConvertNumber(2.14748365e+9f)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-2.147483904e9f) == false); + CHECK(canConvertNumber(-2.147483648e+9f) == true); + CHECK(canConvertNumber(2.14748352e+9f) == true); + CHECK(canConvertNumber(2.14748365e+9f) == false); } SECTION("double -> int32_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-2.147483649e+9)) == false); - CHECK((canConvertNumber(-2.147483648e+9)) == true); - CHECK((canConvertNumber(2.147483647e+9)) == true); - CHECK((canConvertNumber(2.147483648e+9)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-2.147483649e+9) == false); + CHECK(canConvertNumber(-2.147483648e+9) == true); + CHECK(canConvertNumber(2.147483647e+9) == true); + CHECK(canConvertNumber(2.147483648e+9) == false); } SECTION("float -> uint32_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-1.401298e-45f)) == false); - CHECK((canConvertNumber(4.29496704e+9f)) == true); - CHECK((canConvertNumber(4.294967296e+9f)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-1.401298e-45f) == false); + CHECK(canConvertNumber(4.29496704e+9f) == true); + CHECK(canConvertNumber(4.294967296e+9f) == false); } -#if ARDUINOJSON_HAS_LONG_LONG SECTION("float -> int64_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-9.22337204e+18f)) == true); - CHECK((canConvertNumber(9.22337149e+18f)) == true); - CHECK((canConvertNumber(9.22337204e+18f)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-9.22337204e+18f) == true); + CHECK(canConvertNumber(9.22337149e+18f) == true); + CHECK(canConvertNumber(9.22337204e+18f) == false); } SECTION("double -> int64_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-9.2233720368547758e+18)) == true); - CHECK((canConvertNumber(9.2233720368547748e+18)) == true); - CHECK((canConvertNumber(9.2233720368547758e+18)) == false); + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-9.2233720368547758e+18) == true); + CHECK(canConvertNumber(9.2233720368547748e+18) == true); + CHECK(canConvertNumber(9.2233720368547758e+18) == false); } SECTION("float -> uint64_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-1.401298e-45f)) == false); - CHECK((canConvertNumber(1.844674297419792384e+19f)) == - true); - CHECK((canConvertNumber(1.8446744073709551616e+19f)) == + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-1.401298e-45f) == false); + CHECK(canConvertNumber(1.84467429741979238e+19f) == true); + CHECK(canConvertNumber(1.844674407370955161e+19f) == false); } SECTION("double -> uint64_t") { - CHECK((canConvertNumber(0)) == true); - CHECK((canConvertNumber(-4.94065645841247e-324)) == - false); - CHECK((canConvertNumber(1.8446744073709549568e+19)) == - true); - CHECK((canConvertNumber(1.8446744073709551616e+19)) == + CHECK(canConvertNumber(0) == true); + CHECK(canConvertNumber(-4.9406564584124e-324) == false); + CHECK(canConvertNumber(1.844674407370954958e+19) == true); + CHECK(canConvertNumber(1.844674407370955166e+19) == false); } -#endif } diff --git a/third-party/ArduinoJson/extras/tests/Numbers/parseDouble.cpp b/third-party/ArduinoJson/extras/tests/Numbers/parseDouble.cpp index 1ce9a02..301aa0c 100644 --- a/third-party/ArduinoJson/extras/tests/Numbers/parseDouble.cpp +++ b/third-party/ArduinoJson/extras/tests/Numbers/parseDouble.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_USE_DOUBLE 1 @@ -9,7 +9,7 @@ #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; void checkDouble(const char* input, double expected) { CAPTURE(input); diff --git a/third-party/ArduinoJson/extras/tests/Numbers/parseFloat.cpp b/third-party/ArduinoJson/extras/tests/Numbers/parseFloat.cpp index ec69cab..4e9c1d4 100644 --- a/third-party/ArduinoJson/extras/tests/Numbers/parseFloat.cpp +++ b/third-party/ArduinoJson/extras/tests/Numbers/parseFloat.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #define ARDUINOJSON_USE_DOUBLE 0 @@ -9,7 +9,7 @@ #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; void checkFloat(const char* input, float expected) { CAPTURE(input); diff --git a/third-party/ArduinoJson/extras/tests/Numbers/parseInteger.cpp b/third-party/ArduinoJson/extras/tests/Numbers/parseInteger.cpp index aae66e8..880da76 100644 --- a/third-party/ArduinoJson/extras/tests/Numbers/parseInteger.cpp +++ b/third-party/ArduinoJson/extras/tests/Numbers/parseInteger.cpp @@ -1,12 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; template void checkInteger(const char* input, T expected) { diff --git a/third-party/ArduinoJson/extras/tests/Numbers/parseNumber.cpp b/third-party/ArduinoJson/extras/tests/Numbers/parseNumber.cpp index 7dd5aa0..3522151 100644 --- a/third-party/ArduinoJson/extras/tests/Numbers/parseNumber.cpp +++ b/third-party/ArduinoJson/extras/tests/Numbers/parseNumber.cpp @@ -1,11 +1,12 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson; +using namespace ArduinoJson::detail; TEST_CASE("Test unsigned integer overflow") { VariantData first, second; diff --git a/third-party/ArduinoJson/extras/tests/TextFormatter/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/TextFormatter/CMakeLists.txt index 57a3f85..2bc4a89 100644 --- a/third-party/ArduinoJson/extras/tests/TextFormatter/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/TextFormatter/CMakeLists.txt @@ -1,8 +1,8 @@ # ArduinoJson - https://arduinojson.org -# Copyright © 2014-2022, Benoit BLANCHON +# Copyright © 2014-2023, Benoit BLANCHON # MIT License -add_executable(TextFormatterTests +add_executable(TextFormatterTests writeFloat.cpp writeInteger.cpp writeString.cpp @@ -14,5 +14,5 @@ add_test(TextFormatter TextFormatterTests) set_tests_properties(TextFormatter PROPERTIES - LABELS "Catch" + LABELS "Catch" ) diff --git a/third-party/ArduinoJson/extras/tests/TextFormatter/writeFloat.cpp b/third-party/ArduinoJson/extras/tests/TextFormatter/writeFloat.cpp index 87eef3d..8e4bd7e 100644 --- a/third-party/ArduinoJson/extras/tests/TextFormatter/writeFloat.cpp +++ b/third-party/ArduinoJson/extras/tests/TextFormatter/writeFloat.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -11,13 +11,13 @@ #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; template void check(TFloat input, const std::string& expected) { std::string output; Writer sb(output); - TextFormatter > writer(sb); + TextFormatter> writer(sb); writer.writeFloat(input); REQUIRE(writer.bytesWritten() == output.size()); CHECK(expected == output); diff --git a/third-party/ArduinoJson/extras/tests/TextFormatter/writeInteger.cpp b/third-party/ArduinoJson/extras/tests/TextFormatter/writeInteger.cpp index cc29fc0..20cbd29 100644 --- a/third-party/ArduinoJson/extras/tests/TextFormatter/writeInteger.cpp +++ b/third-party/ArduinoJson/extras/tests/TextFormatter/writeInteger.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -9,7 +9,7 @@ #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; template void checkWriteInteger(T value, std::string expected) { diff --git a/third-party/ArduinoJson/extras/tests/TextFormatter/writeString.cpp b/third-party/ArduinoJson/extras/tests/TextFormatter/writeString.cpp index 67b12b5..2be9191 100644 --- a/third-party/ArduinoJson/extras/tests/TextFormatter/writeString.cpp +++ b/third-party/ArduinoJson/extras/tests/TextFormatter/writeString.cpp @@ -1,5 +1,5 @@ // ArduinoJson - https://arduinojson.org -// Copyright © 2014-2022, Benoit BLANCHON +// Copyright © 2014-2023, Benoit BLANCHON // MIT License #include @@ -7,7 +7,7 @@ #include #include -using namespace ARDUINOJSON_NAMESPACE; +using namespace ArduinoJson::detail; void check(const char* input, std::string expected) { char output[64] = {0}; diff --git a/third-party/ArduinoJson/extras/tests/catch/CMakeLists.txt b/third-party/ArduinoJson/extras/tests/catch/CMakeLists.txt index 776a07a..c5fb5fb 100644 --- a/third-party/ArduinoJson/extras/tests/catch/CMakeLists.txt +++ b/third-party/ArduinoJson/extras/tests/catch/CMakeLists.txt @@ -2,7 +2,7 @@ # Copyright Benoit Blanchon 2014-2021 # MIT License -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED OFF) add_library(catch @@ -12,10 +12,10 @@ add_library(catch target_include_directories(catch PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} ) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - # prevent "xxx will change in GCC x.x" with arm-linux-gnueabihf-gcc - target_compile_options(catch PRIVATE -Wno-psabi) +if(MINGW) + # prevent "too many sections (32837)" with MinGW + target_compile_options(catch PRIVATE -Wa,-mbig-obj) endif() diff --git a/third-party/ArduinoJson/extras/tests/catch/catch.hpp b/third-party/ArduinoJson/extras/tests/catch/catch.hpp index fe13018..9b309bd 100644 --- a/third-party/ArduinoJson/extras/tests/catch/catch.hpp +++ b/third-party/ArduinoJson/extras/tests/catch/catch.hpp @@ -1,17 +1,21 @@ /* - * Catch v1.12.2 - * Generated: 2023-01-17 08:45:40.979381 + * Catch v2.13.10 + * Generated: 2022-10-16 11:01:23.452308 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly - * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. + * Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED #define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +// start catch.hpp -#define TWOBLUECUBES_CATCH_HPP_INCLUDED + +#define CATCH_VERSION_MAJOR 2 +#define CATCH_VERSION_MINOR 13 +#define CATCH_VERSION_PATCH 10 #ifdef __clang__ # pragma clang system_header @@ -19,36 +23,69 @@ # pragma GCC system_header #endif -// #included from: internal/catch_suppress_warnings.h +// start catch_suppress_warnings.h #ifdef __clang__ # ifdef __ICC // icpc defines the __clang__ macro # pragma warning(push) # pragma warning(disable: 161 1682) # else // __ICC -# pragma clang diagnostic ignored "-Wglobal-constructors" -# pragma clang diagnostic ignored "-Wvariadic-macros" -# pragma clang diagnostic ignored "-Wc99-extensions" -# pragma clang diagnostic ignored "-Wunused-variable" # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wc++98-compat" -# pragma clang diagnostic ignored "-Wc++98-compat-pedantic" # pragma clang diagnostic ignored "-Wswitch-enum" # pragma clang diagnostic ignored "-Wcovered-switch-default" # endif #elif defined __GNUC__ -# pragma GCC diagnostic ignored "-Wvariadic-macros" -# pragma GCC diagnostic ignored "-Wunused-variable" -# pragma GCC diagnostic ignored "-Wparentheses" + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details # pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-Wpadded" #endif +// end catch_suppress_warnings.h #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) # define CATCH_IMPL +# define CATCH_CONFIG_ALL_PARTS +#endif + +// In the impl file, we want to have access to all parts of the headers +// Can also be used to sanely support PCHs +#if defined(CATCH_CONFIG_ALL_PARTS) +# define CATCH_CONFIG_EXTERNAL_INTERFACES +# if defined(CATCH_CONFIG_DISABLE_MATCHERS) +# undef CATCH_CONFIG_DISABLE_MATCHERS +# endif +# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# endif +#endif + +#if !defined(CATCH_CONFIG_IMPL_ONLY) +// start catch_platform.h + +// See e.g.: +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html +#ifdef __APPLE__ +# include +# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ + (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) +# define CATCH_PLATFORM_MAC +# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) +# define CATCH_PLATFORM_IPHONE +# endif + +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CATCH_PLATFORM_LINUX + +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) +# define CATCH_PLATFORM_WINDOWS #endif +// end catch_platform.h + #ifdef CATCH_IMPL # ifndef CLARA_CONFIG_MAIN # define CLARA_CONFIG_MAIN_NOT_DEFINED @@ -56,93 +93,106 @@ # endif #endif -// #included from: internal/catch_notimplemented_exception.h -#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED +// start catch_user_interfaces.h -// #included from: catch_common.h -#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED +namespace Catch { + unsigned int rngSeed(); +} + +// end catch_user_interfaces.h +// start catch_tag_alias_autoregistrar.h -// #included from: catch_compiler_capabilities.h -#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED +// start catch_common.h -// Detect a number of compiler features - mostly C++11/14 conformance - by compiler +// start catch_compiler_capabilities.h + +// Detect a number of compiler features - by compiler // The following features are defined: // -// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported? -// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported? -// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods -// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported? -// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported -// CATCH_CONFIG_CPP11_LONG_LONG : is long long supported? -// CATCH_CONFIG_CPP11_OVERRIDE : is override supported? -// CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr) -// CATCH_CONFIG_CPP11_SHUFFLE : is std::shuffle supported? -// CATCH_CONFIG_CPP11_TYPE_TRAITS : are type_traits and enable_if supported? - -// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported? - -// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported? // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? // CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? // CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? +// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? // **************** // Note to maintainers: if new toggles are added please document them // in configuration.md, too // **************** // In general each macro has a _NO_ form -// (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature. +// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. // Many features, at point of detection, define an _INTERNAL_ macro, so they // can be combined, en-mass, with the _NO_ forms later. -// All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11 - #ifdef __cplusplus -# if __cplusplus >= 201103L -# define CATCH_CPP11_OR_GREATER +# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) +# define CATCH_CPP14_OR_GREATER # endif -# if __cplusplus >= 201402L -# define CATCH_CPP14_OR_GREATER +# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define CATCH_CPP17_OR_GREATER # endif #endif -#ifdef __clang__ +// Only GCC compiler should be used in this block, so other compilers trying to +// mask themselves as GCC should be ignored. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) -# if __has_feature(cxx_nullptr) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# endif +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) + +#endif -# if __has_feature(cxx_noexcept) -# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT +#if defined(__clang__) + +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) + +// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug +// which results in calls to destructors being emitted for each temporary, +// without a matching initialization. In practice, this can result in something +// like `std::string::~string` being called on an uninitialized value. +// +// For example, this code will likely segfault under IBM XL: +// ``` +// REQUIRE(std::string("12") + "34" == "1234") +// ``` +// +// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. +# if !defined(__ibmxl__) && !defined(__CUDACC__) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ # endif -# if defined(CATCH_CPP11_OR_GREATER) -# define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ - _Pragma( "clang diagnostic pop" ) -# endif +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ + _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") + +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) + +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) #endif // __clang__ //////////////////////////////////////////////////////////////////////////////// -// We know some environments not to support full POSIX signals -#if defined(__CYGWIN__) || defined(__QNX__) - -# if !defined(CATCH_CONFIG_POSIX_SIGNALS) -# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS -# endif +// Assume that non-Windows platforms support posix signals by default +#if !defined(CATCH_PLATFORM_WINDOWS) + #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS +#endif +//////////////////////////////////////////////////////////////////////////////// +// We know some environments not to support full POSIX signals +#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) + #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS #endif #ifdef __OS400__ @@ -150,6 +200,25 @@ # define CATCH_CONFIG_COLOUR_NONE #endif +//////////////////////////////////////////////////////////////////////////////// +// Android somehow still does not support std::to_string +#if defined(__ANDROID__) +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Not all Windows environments support SEH properly +#if defined(__MINGW32__) +# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#endif + +//////////////////////////////////////////////////////////////////////////////// +// PS4 +#if defined(__ORBIS__) +# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE +#endif + //////////////////////////////////////////////////////////////////////////////// // Cygwin #ifdef __CYGWIN__ @@ -157,219 +226,245 @@ // Required for some versions of Cygwin to declare gettimeofday // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin # define _BSD_SOURCE +// some versions of cygwin (most) do not support std::to_string. Use the libstd check. +// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 +# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ + && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) -#endif // __CYGWIN__ - -//////////////////////////////////////////////////////////////////////////////// -// Borland -#ifdef __BORLANDC__ +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING -#endif // __BORLANDC__ +# endif +#endif // __CYGWIN__ //////////////////////////////////////////////////////////////////////////////// -// EDG -#ifdef __EDG_VERSION__ - -#endif // __EDG_VERSION__ +// Visual C++ +#if defined(_MSC_VER) -//////////////////////////////////////////////////////////////////////////////// -// Digital Mars -#ifdef __DMC__ +// Universal Windows platform does not support SEH +// Or console colours (or console at all...) +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +# define CATCH_CONFIG_COLOUR_NONE +# else +# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH +# endif -#endif // __DMC__ +# if !defined(__clang__) // Handle Clang masquerading for msvc -//////////////////////////////////////////////////////////////////////////////// -// GCC -#ifdef __GNUC__ +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif // MSVC_TRADITIONAL -# if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# endif +// Only do this if we're not using clang on Windows, which uses `diagnostic push` & `diagnostic pop` +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) +# endif // __clang__ -// - otherwise more recent versions define __cplusplus >= 201103L -// and will get picked up below +#endif // _MSC_VER -#endif // __GNUC__ +#if defined(_REENTRANT) || defined(_MSC_VER) +// Enable async processing, as -pthread is specified or no additional linking is required +# define CATCH_INTERNAL_CONFIG_USE_ASYNC +#endif // _MSC_VER //////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH - -#if (_MSC_VER >= 1600) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR +// Check if we are compiled with -fno-exceptions or equivalent +#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) +# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED #endif -#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015)) -#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -#define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE -#define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS -#endif - -#endif // _MSC_VER - //////////////////////////////////////////////////////////////////////////////// +// DJGPP +#ifdef __DJGPP__ +# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#endif // __DJGPP__ -// Use variadic macros if the compiler supports them -#if ( defined _MSC_VER && _MSC_VER >= 1400 && !defined __EDGE__) || \ - ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \ - ( defined __GNUC__ && __GNUC__ >= 3 ) || \ - ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L ) - -#define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS - +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN #endif -// Use __COUNTER__ if the compiler supports it -#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \ - ( defined __GNUC__ && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 )) ) || \ - ( defined __clang__ && __clang_major__ >= 3 ) +//////////////////////////////////////////////////////////////////////////////// -// Use of __COUNTER__ is suppressed during code analysis in CLion/AppCode 2017.2.x and former, -// because __COUNTER__ is not properly handled by it. -// This does not affect compilation -#if ( !defined __JETBRAINS_IDE__ || __JETBRAINS_IDE__ >= 20170300L ) +// Use of __COUNTER__ is suppressed during code analysis in +// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly +// handled by it. +// Otherwise all supported compilers support COUNTER macro, +// but user still might want to turn it off +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) #define CATCH_INTERNAL_CONFIG_COUNTER #endif -#endif - //////////////////////////////////////////////////////////////////////////////// -// C++ language feature support -// catch all support for C++11 -#if defined(CATCH_CPP11_OR_GREATER) - -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) -# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR -# endif +// RTX is a special version of Windows that is real time. +// This means that it is detected as Windows, but does not provide +// the same set of capabilities as real Windows does. +#if defined(UNDER_RTSS) || defined(RTX64_BUILD) + #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH + #define CATCH_INTERNAL_CONFIG_NO_ASYNC + #define CATCH_CONFIG_COLOUR_NONE +#endif -# ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT -# endif +#if !defined(_GLIBCXX_USE_C99_MATH_TR1) +#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER +#endif -# ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -# define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS -# endif +// Various stdlib support checks that require __has_include +#if defined(__has_include) + // Check if string_view is available and usable + #if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW + #endif + + // Check if optional is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if byte is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # include + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) + # define CATCH_INTERNAL_CONFIG_CPP17_BYTE + # endif + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if variant is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # if defined(__clang__) && (__clang_major__ < 8) + // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 + // fix should be in clang 8, workaround in libstdc++ 8.2 + # include + # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # define CATCH_CONFIG_NO_CPP17_VARIANT + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__clang__) && (__clang_major__ < 8) + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) +#endif // defined(__has_include) -# ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM -# define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM -# endif +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) +# define CATCH_CONFIG_COUNTER +#endif +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) +# define CATCH_CONFIG_WINDOWS_SEH +#endif +// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. +#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_CONFIG_POSIX_SIGNALS +#endif +// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. +#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) +# define CATCH_CONFIG_WCHAR +#endif -# ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE -# define CATCH_INTERNAL_CONFIG_CPP11_TUPLE -# endif +#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) +# define CATCH_CONFIG_CPP11_TO_STRING +#endif -# ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS -# define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS -# endif +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) -# define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG -# endif +#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) +# define CATCH_CONFIG_CPP17_STRING_VIEW +#endif -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) -# define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE -# endif -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) -# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR -# endif -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) -# define CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE -# endif -# if !defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) -# define CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS -# endif +#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) +# define CATCH_CONFIG_CPP17_VARIANT +#endif -#endif // __cplusplus >= 201103L +#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) +# define CATCH_CONFIG_CPP17_BYTE +#endif -// Now set the actual defines based on the above + anything the user has configured -#if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_NULLPTR +#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) +# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_NOEXCEPT + +#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) +# define CATCH_CONFIG_NEW_CAPTURE #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_GENERATED_METHODS + +#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +# define CATCH_CONFIG_DISABLE_EXCEPTIONS #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_IS_ENUM + +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_TUPLE + +#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) +# define CATCH_CONFIG_USE_ASYNC #endif -#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS) -# define CATCH_CONFIG_VARIADIC_MACROS + +#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) +# define CATCH_CONFIG_ANDROID_LOGWRITE #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_LONG_LONG + +#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) +# define CATCH_CONFIG_GLOBAL_NEXTAFTER #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_OVERRIDE + +// Even if we do not think the compiler has that warning, we still have +// to provide a macro that can be used by the code. +#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_UNIQUE_PTR +#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION #endif -#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) -# define CATCH_CONFIG_COUNTER +#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_SHUFFLE +#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS #endif -# if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11) -# define CATCH_CONFIG_CPP11_TYPE_TRAITS -# endif -#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) -# define CATCH_CONFIG_WINDOWS_SEH +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS #endif -// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. -#if !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) -# define CATCH_CONFIG_POSIX_SIGNALS +#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS #endif -#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS -#endif -#if !defined(CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_ETD_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_ETD_WARNINGS +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) #endif -// noexcept support: -#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT) -# define CATCH_NOEXCEPT noexcept -# define CATCH_NOEXCEPT_IS(x) noexcept(x) -#else -# define CATCH_NOEXCEPT throw() -# define CATCH_NOEXCEPT_IS(x) +#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#elif defined(__clang__) && (__clang_major__ < 5) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #endif -// nullptr support -#ifdef CATCH_CONFIG_CPP11_NULLPTR -# define CATCH_NULL nullptr -#else -# define CATCH_NULL NULL +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS #endif -// override support -#ifdef CATCH_CONFIG_CPP11_OVERRIDE -# define CATCH_OVERRIDE override +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#define CATCH_TRY if ((true)) +#define CATCH_CATCH_ALL if ((false)) +#define CATCH_CATCH_ANON(type) if ((false)) #else -# define CATCH_OVERRIDE +#define CATCH_TRY try +#define CATCH_CATCH_ALL catch (...) +#define CATCH_CATCH_ANON(type) catch (type) #endif -// unique_ptr support -#ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR -# define CATCH_AUTO_PTR( T ) std::unique_ptr -#else -# define CATCH_AUTO_PTR( T ) std::auto_ptr +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif +// end catch_compiler_capabilities.h #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) #ifdef CATCH_CONFIG_COUNTER @@ -378,95 +473,48 @@ # define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) #endif -#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr -#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr ) +#include +#include +#include -#include -#include +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); namespace Catch { - struct IConfig; - struct CaseSensitive { enum Choice { Yes, No }; }; class NonCopyable { -#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS NonCopyable( NonCopyable const& ) = delete; NonCopyable( NonCopyable && ) = delete; NonCopyable& operator = ( NonCopyable const& ) = delete; NonCopyable& operator = ( NonCopyable && ) = delete; -#else - NonCopyable( NonCopyable const& info ); - NonCopyable& operator = ( NonCopyable const& ); -#endif protected: - NonCopyable() {} + NonCopyable(); virtual ~NonCopyable(); }; - class SafeBool { - public: - typedef void (SafeBool::*type)() const; - - static type makeSafe( bool value ) { - return value ? &SafeBool::trueValue : 0; - } - private: - void trueValue() const {} - }; - - template - void deleteAll( ContainerT& container ) { - typename ContainerT::const_iterator it = container.begin(); - typename ContainerT::const_iterator itEnd = container.end(); - for(; it != itEnd; ++it ) - delete *it; - } - template - void deleteAllValues( AssociativeContainerT& container ) { - typename AssociativeContainerT::const_iterator it = container.begin(); - typename AssociativeContainerT::const_iterator itEnd = container.end(); - for(; it != itEnd; ++it ) - delete it->second; - } - - bool startsWith( std::string const& s, std::string const& prefix ); - bool startsWith( std::string const& s, char prefix ); - bool endsWith( std::string const& s, std::string const& suffix ); - bool endsWith( std::string const& s, char suffix ); - bool contains( std::string const& s, std::string const& infix ); - void toLowerInPlace( std::string& s ); - std::string toLower( std::string const& s ); - std::string trim( std::string const& str ); - bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ); - - struct pluralise { - pluralise( std::size_t count, std::string const& label ); - - friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); + struct SourceLineInfo { - std::size_t m_count; - std::string m_label; - }; + SourceLineInfo() = delete; + SourceLineInfo( char const* _file, std::size_t _line ) noexcept + : file( _file ), + line( _line ) + {} - struct SourceLineInfo { + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; - SourceLineInfo(); - SourceLineInfo( char const* _file, std::size_t _line ); -# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS - SourceLineInfo(SourceLineInfo const& other) = default; - SourceLineInfo( SourceLineInfo && ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo& operator = ( SourceLineInfo && ) = default; -# endif - bool empty() const; - bool operator == ( SourceLineInfo const& other ) const; - bool operator < ( SourceLineInfo const& other ) const; + bool empty() const noexcept { return file[0] == '\0'; } + bool operator == ( SourceLineInfo const& other ) const noexcept; + bool operator < ( SourceLineInfo const& other ) const noexcept; char const* file; std::size_t line; @@ -474,24 +522,17 @@ namespace Catch { std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); - // This is just here to avoid compiler warnings with macro constants and boolean literals - inline bool isTrue( bool value ){ return value; } - inline bool alwaysTrue() { return true; } - inline bool alwaysFalse() { return false; } - - void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ); - - void seedRng( IConfig const& config ); - unsigned int rngSeed(); + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; // Use this in variadic streaming macros to allow // >> +StreamEndStop // as well as // >> stuff +StreamEndStop struct StreamEndStop { - std::string operator+() { - return std::string(); - } + std::string operator+() const; }; template T const& operator + ( T const& value, StreamEndStop ) { @@ -499,363 +540,812 @@ namespace Catch { } } -#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) -#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO ); +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) +// end catch_common.h namespace Catch { - class NotImplementedException : public std::exception - { - public: - NotImplementedException( SourceLineInfo const& lineInfo ); - - virtual ~NotImplementedException() CATCH_NOEXCEPT {} - - virtual const char* what() const CATCH_NOEXCEPT; - - private: - std::string m_what; - SourceLineInfo m_lineInfo; + struct RegistrarForTagAliases { + RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); }; } // end namespace Catch -/////////////////////////////////////////////////////////////////////////////// -#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO ) +#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -// #included from: internal/catch_context.h -#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED +// end catch_tag_alias_autoregistrar.h +// start catch_test_registry.h -// #included from: catch_interfaces_generators.h -#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED +// start catch_interfaces_testcase.h -#include +#include namespace Catch { - struct IGeneratorInfo { - virtual ~IGeneratorInfo(); - virtual bool moveNext() = 0; - virtual std::size_t getCurrentIndex() const = 0; + class TestSpec; + + struct ITestInvoker { + virtual void invoke () const = 0; + virtual ~ITestInvoker(); }; - struct IGeneratorsForTest { - virtual ~IGeneratorsForTest(); + class TestCase; + struct IConfig; - virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0; - virtual bool moveNext() = 0; + struct ITestCaseRegistry { + virtual ~ITestCaseRegistry(); + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; }; - IGeneratorsForTest* createGeneratorsForTest(); + bool isThrowSafe( TestCase const& testCase, IConfig const& config ); + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); -} // end namespace Catch +} -// #included from: catch_ptr.hpp -#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED +// end catch_interfaces_testcase.h +// start catch_stringref.h -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wpadded" -#endif +#include +#include +#include +#include namespace Catch { - // An intrusive reference counting smart pointer. - // T must implement addRef() and release() methods - // typically implementing the IShared interface - template - class Ptr { + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. + class StringRef { public: - Ptr() : m_p( CATCH_NULL ){} - Ptr( T* p ) : m_p( p ){ - if( m_p ) - m_p->addRef(); - } - Ptr( Ptr const& other ) : m_p( other.m_p ){ - if( m_p ) - m_p->addRef(); - } - ~Ptr(){ - if( m_p ) - m_p->release(); - } - void reset() { - if( m_p ) - m_p->release(); - m_p = CATCH_NULL; - } - Ptr& operator = ( T* p ){ - Ptr temp( p ); - swap( temp ); - return *this; - } - Ptr& operator = ( Ptr const& other ){ - Ptr temp( other ); - swap( temp ); - return *this; - } - void swap( Ptr& other ) { std::swap( m_p, other.m_p ); } - T* get() const{ return m_p; } - T& operator*() const { return *m_p; } - T* operator->() const { return m_p; } - bool operator !() const { return m_p == CATCH_NULL; } - operator SafeBool::type() const { return SafeBool::makeSafe( m_p != CATCH_NULL ); } + using size_type = std::size_t; + using const_iterator = const char*; private: - T* m_p; - }; + static constexpr char const* const s_empty = ""; - struct IShared : NonCopyable { - virtual ~IShared(); - virtual void addRef() const = 0; - virtual void release() const = 0; - }; + char const* m_start = s_empty; + size_type m_size = 0; + + public: // construction + constexpr StringRef() noexcept = default; - template - struct SharedImpl : T { + StringRef( char const* rawChars ) noexcept; - SharedImpl() : m_rc( 0 ){} + constexpr StringRef( char const* rawChars, size_type size ) noexcept + : m_start( rawChars ), + m_size( size ) + {} + + StringRef( std::string const& stdString ) noexcept + : m_start( stdString.c_str() ), + m_size( stdString.size() ) + {} - virtual void addRef() const { - ++m_rc; + explicit operator std::string() const { + return std::string(m_start, m_size); } - virtual void release() const { - if( --m_rc == 0 ) - delete this; + + public: // operators + auto operator == ( StringRef const& other ) const noexcept -> bool; + auto operator != (StringRef const& other) const noexcept -> bool { + return !(*this == other); } - mutable unsigned int m_rc; - }; + auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } -} // end namespace Catch + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } -#ifdef __clang__ -#pragma clang diagnostic pop -#endif + // Returns the current start pointer. If the StringRef is not + // null-terminated, throws std::domain_exception + auto c_str() const -> char const*; -namespace Catch { + public: // substrings and searches + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, size()). + // If start > size(), then the substring is empty. + auto substr( size_type start, size_type length ) const noexcept -> StringRef; - class TestCase; - class Stream; - struct IResultCapture; - struct IRunner; - struct IGeneratorsForTest; - struct IConfig; + // Returns the current start pointer. May not be null-terminated. + auto data() const noexcept -> char const*; - struct IContext - { - virtual ~IContext(); + constexpr auto isNullTerminated() const noexcept -> bool { + return m_start[m_size] == '\0'; + } - virtual IResultCapture* getResultCapture() = 0; - virtual IRunner* getRunner() = 0; - virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0; - virtual bool advanceGeneratorsForCurrentTest() = 0; - virtual Ptr getConfig() const = 0; + public: // iterators + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } }; - struct IMutableContext : IContext - { - virtual ~IMutableContext(); - virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; - virtual void setConfig( Ptr const& config ) = 0; - }; + auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; + auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; - IContext& getCurrentContext(); - IMutableContext& getCurrentMutableContext(); - void cleanUpContext(); - Stream createStream( std::string const& streamName ); + constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + return StringRef( rawChars, size ); + } +} // namespace Catch +constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { + return Catch::StringRef( rawChars, size ); } -// #included from: internal/catch_test_registry.hpp -#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED +// end catch_stringref.h +// start catch_preprocessor.hpp -// #included from: catch_interfaces_testcase.h -#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED -#include +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) -namespace Catch { +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif - class TestSpec; +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif - struct ITestCase : IShared { - virtual void invoke () const = 0; - protected: - virtual ~ITestCase(); - }; +#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ +#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) - class TestCase; - struct IConfig; +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) - struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); - virtual std::vector const& getAllTests() const = 0; - virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) + +#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) +#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) +#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) +#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) +#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) +#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) +#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6) +#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) +#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) +#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) +#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + +#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N + +#define INTERNAL_CATCH_TYPE_GEN\ + template struct TypeList {};\ + template\ + constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ + template class...> struct TemplateTypeList{};\ + template class...Cs>\ + constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\ + template\ + struct append;\ + template\ + struct rewrap;\ + template class, typename...>\ + struct create;\ + template class, typename>\ + struct convert;\ + \ + template \ + struct append { using type = T; };\ + template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ + struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\ + template< template class L1, typename...E1, typename...Rest>\ + struct append, TypeList, Rest...> { using type = L1; };\ + \ + template< template class Container, template class List, typename...elems>\ + struct rewrap, List> { using type = TypeList>; };\ + template< template class Container, template class List, class...Elems, typename...Elements>\ + struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\ + \ + template