mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 02:07:32 +02:00
@ -32,8 +32,18 @@ endif()
|
||||
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)
|
||||
else() # GCC 4.8
|
||||
add_compile_options(
|
||||
-g
|
||||
-O0 # GCC 4.8 doesn't support -Og
|
||||
-Wno-shadow # allow the same name for a function parameter and a member functions
|
||||
-Wp,-w # Disable preprocessing warnings (see below)
|
||||
)
|
||||
# GCC 4.8 doesn't support __has_include, so we need to help him
|
||||
add_definitions(
|
||||
-DARDUINOJSON_ENABLE_STD_STRING=1
|
||||
-DARDUINOJSON_ENABLE_STD_STREAM=1
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_options(
|
||||
|
@ -90,6 +90,10 @@ class AllocatorLog {
|
||||
append(entry);
|
||||
}
|
||||
|
||||
void clear() {
|
||||
log_.str("");
|
||||
}
|
||||
|
||||
void append(const AllocatorLogEntry& entry) {
|
||||
for (size_t i = 0; i < entry.count(); i++)
|
||||
log_ << entry.str() << "\n";
|
||||
@ -165,7 +169,7 @@ class SpyingAllocator : public ArduinoJson::Allocator {
|
||||
}
|
||||
|
||||
void clearLog() {
|
||||
log_ = AllocatorLog();
|
||||
log_.clear();
|
||||
}
|
||||
|
||||
const AllocatorLog& log() const {
|
||||
|
@ -212,3 +212,8 @@ TEST_CASE("Polyfills/type_traits") {
|
||||
CHECK(is_enum<double>::value == false);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("is_std_string") {
|
||||
REQUIRE(is_std_string<std::string>::value == true);
|
||||
REQUIRE(is_std_string<EmptyClass>::value == false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user